[英]php soap call problem passing a parameter
I've created this SOAP call我创建了这个 SOAP 调用
header('Content-Type: text/html; charset=utf-8');
ini_set('soap.wsdl_cache_enable', 0 );
ini_set('soap.wsdl_cache_ttl', 0 );
ini_set('memory_limit','64M');
ini_set('max_execution_time', 1500);
$loc = "https://MyEndPoint";
$urlWSDL = $loc . ".wsdl";
$ops = array(
'trace' => 1,
'exceptions' => 0,
'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE,
'style' => SOAP_DOCUMENT,
'use' => SOAP_LITERAL,
'soap_version' => SOAP_1_1,
"ResponseType" => "Xml",
'encoding' => 'UTF-8'
);
try
{
$clientSOAP = new SoapClient($urlWSDL, $ops);
$clientSOAP->__setLocation($loc);
}
catch (e $exception) {
ECHO "WS not active";
}
try {
$params = array(
"customer id='reset'" => "Cust " ,
"value" => "MyValue"
);
$result = $clientSOAP->sendCustomer($params);
$strresult = $clientSOAP->__getLastResponse();
} catch (SoapFault $exception) {
echo '<h2>EXCEPTION</h2>';
echo "det.::\n" . $clientSOAP->__getLastResponse() . "\n";
echo $exception;
}
But I alway get an error in line但我总是遇到错误
"customer id='reset'" => "Cust " ,
removing去除
id='reset'
id='重置'
the call works correctly, but I need to pass that id.通话正常,但我需要传递该 ID。
Any ideas?有任何想法吗?
I've tried with no results:我试过没有结果:
"customer id="reset"" => "Cust " ,
I've also tried to replace double quotes by single, but I get an error always in the same line我也尝试用单引号替换双引号,但总是在同一行出现错误
I have also tried to make the call from third party software, and the call is made correctly and the results are as expected我也尝试过从第三方软件拨打电话,拨打电话正确,结果符合预期
The structure should be结构应该是
<customer id='reset'>
myCust
</customer>
Thanks Jam谢谢果酱
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.