使用PHP SoapClient的,我做的WSDL調用在https://webservices-test.ede.de:9443/ibis/ws/WS_EXT_ELC?wsdl和我得到以下XML響應(通過$soapclient->__last_response
所示)PHP SoapClient的返回null,甚至認爲有一個響應
<?xml version='1.0' encoding='UTF-8'?><soap:Envelope xmlns:ede="http://ede.de/webservices" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Body><Response action="ELC" requestId="1" version="1.0"><created>2017-09-04T16:04:46.556+02:00</created><StatusInformation>OK</StatusInformation><StatusCode>0</StatusCode><Payload><SalesOrderSimulateConfirmation><Items><Item><ID>10</ID><ProductID>0003062700050</ProductID><Price>2.970</Price><PositionPrice>2.970</PositionPrice><PriceUnit>1</PriceUnit><QuantityUnit>ST</QuantityUnit><QuantityAvailable>1</QuantityAvailable><QuantityProfile>1</QuantityProfile><Currency>EUR</Currency><Services /><Schedules>Geplante Liefertermine: 1 ST in KW 36.2017;</Schedules><Remark /><DangerMaterial /></Item></Items></SalesOrderSimulateConfirmation></Payload></Response></soap:Body></soap:Envelope>
儘管如此,來電$soapclient->simulateOrder()
回報null
。
如何讓PHP SoapClient的返回一個對象,而不是空的?
注:我使用的肥皂調用XML手動生成由一個覆蓋到SoapClient::__doRequest()
。爲SOAP調用的代碼如下所示:
$soapClient = new SoapClient('https://webservices-test.ede.de:9443/ibis/ws/WS_EXT_ELC?wsdl', array(
'cache_wsdl' => WSDL_CACHE_NONE,
'trace' => true,
'exceptions' => true,
'soap_version' => SOAP_1_2,
'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
'login' => '------', // cannot post here for security purposes
'password' => '-----', // cannot post here for security purposes
'stream_context' => (
stream_context_create(array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
))
));
$result = $soapClient->simulateOrder();
沒有異常拋出,但$result
是null
你能告訴我們你的函數simulateOrder()嗎? –