SoapException Server无法处理PHP中的ASMX Web服务上的请求

时间:2019-09-16 11:39:24

标签: web-services model-view-controller request asmx

我正在使用Soap API,并且在卷曲结果上出错。

  

“ soap:ServerServer无法处理请求。--->值不能为   空值。参数名称:s“

我正在为该任务使用PHP

$datasource = 'testdatasource';
$url = 'HOSTNAME:8182/merlin.asmx';

$soapEnvelope = '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<SetCustomer>
<datasource>mbstrainpost</datasource><xml><customer>
<usernum>99</usernum>
<name>Rajendra Singh rathore</name>
<add1>Chatsworth Hossuxse</add1>
<add2>Millenium Way</add2>
<city>Chesterfield</city>
</customer></xml>
</SetCustomer>
</soap:Body>
</soap:Envelope>';
$host = 'HostName';
$page = '/Merlin.asmx';
// create curl client
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; FreeBSD i386;en-US;)');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 180);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $soapEnvelope);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('POST ' . $page . ' HTTP/1.1', 'HOST: ' . $host, 'Content-Type: text/xml; charset=utf-8', 'Content-length: ' . strlen($soapEnvelope), 'SOAPAction: "CCBS/SetCustomer"'));
// execute SetOrder and return response
$result = curl_exec($ch);

0 个答案:

没有答案