我的php soapclient項目存在問題。 由於現在我用curl發送soap請求,但由於不同的原因,我必須使用PHP的集成soap客戶端。具有多個命名空間的PHP SOAP客戶端
我用於捲曲我的(工作)的要求是這樣的:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:asc="http://asc.ws.ideal.com" xmlns:xsd="http://getserviceeventstatus.info.asc.ws.ideal.com/xsd">
<soap:Header/>
<soap:Body>
<asc:getServiceEventStatus>
<asc:param>
<xsd:info>
<xsd:includePreviousEventsInfo>true</xsd:includePreviousEventsInfo>
<xsd:mainAscReferenceId>16111294</xsd:mainAscReferenceId>
</xsd:info>
<xsd:password>xxx</xsd:password>
<xsd:userId>xxx</xsd:userId>
</asc:param>
</asc:getServiceEventStatus>
</soap:Body>
</soap:Envelope>
我實際的PHP腳本看起來像......
<?php
error_reporting(E_ALL);
$wsdl = '/services/AscServiceSync?wsdl';
$location = '/services/AscServiceSync.AscServiceSyncHttpSoap11Endpoint/';
$options = array(
'uri'=>'http://schemas.xmlsoap.org/soap/envelope/',
'style'=>SOAP_RPC,
'use'=>SOAP_ENCODED,
'soap_version'=>SOAP_1_1,
'cache_wsdl'=>WSDL_CACHE_NONE,
'connection_timeout'=>15,
'trace'=>true,
'encoding'=>'UTF-8',
'exceptions'=>true,
"location"=>$location
);
$client = new SoapClient($wsdl, $options);
$result = $client->getServiceEventStatus(array('userId' => 'xxx', 'password' => 'xxx', 'mainAscReferenceId' => '16111294'));
var_dump ($result);
print '<br />';
print $result->success;
print '<br />';
?>
服務器返回的錯誤信息,即「參數」或「信息」數據丟失
希望有人能幫助我 謝謝!
您可以使用Fiddler2或其他數據包嗅探器來查看您發送的內容嗎?這會告訴你不同之處。 –