ich versuche eine externe Anwendung über PHP Soap per wsdl anzusprechen und einen Kundennummer als request und information des Kundennummer als result. Über die Funktion __getfunctions() und __getTypes bekomme ich aber die benötigten Information geliefert.
Functions
GetNrListResponseType GetNrList(GetNrListType $body)
GetNrListResponseType GetNrList(GetNrListType $body)
Types
struct GetNrListType { string CardCode; }
struct GetNrListResponseType { GetNrListResult GetNrListResult; }
struct GetNrListResult { row row; }
struct row { string CardName; string CardCode; string DocStatus; string DocDate; string Address; }
PHP Client
PHP-Code:
<?php
#Define Authentication
$options = array();
$options['login'] = 'xxxxx';
$options['password'] = 'xxxxx;
$option['trace'] = '1';
$options['classmap']['GetNrList'] = 'RequestType';
$options['classmap']['GetNrListResponse'] = 'ResponseType';
$options['classmap']['GetNrListResult'] = 'ResultType';
$options['classmap']['row'] = 'Row';
#Specify WSDL
$WSDL = "http://192.168.0.xxx:8080/.../vPac.Z.Test1/001sap0003_Z.Test1.wsdl";
//$Entry = $_POST["nummer"];
$Entry = '281981';
class RequestType
{
public $CardCode;
}
class ResponseType
{
public $GetNrListResult;
}
class ResultType
{
public $row;
}
class Row
{
public $CardName;
public $DocStatus;
public $CardCode;
public $Address;
}
$NrList = new RequestType;
$NrList->CardCode = $Entry;
try
{
#Create Client Object, download and parse WSDL
$client = new SoapClient($WSDL,$options);
#Call Operation (Function). Catch and display any errors
}
catch (Exception $e)
{
echo "Error!";
echo $e -> getMessage ();
echo 'Last response: '. $client->__getLastResponse();
}
$result=$client->GetNrList($NrList);
print_r($result);
echo "CardCode: ". $NrList->CardCode .
" Name: ".$result>GetNrListResult->row->CardName .
" Ort: ". $result->GetNrListResult->row->Address;
?>
print_r(result);
PHP-Code:
stdClass Object ( [GetNrListResult] => ResultType Object ( [row] => ) )
aber bei PHP nicht.

wie kriege ich den Result in PHP zurück?
Einen Kommentar schreiben: