[英]php soap call problem passing a parameter
我创建了这个 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;
}
但我总是遇到错误
"customer id='reset'" => "Cust " ,
去除
id='重置'
通话正常,但我需要传递该 ID。
有任何想法吗?
我试过没有结果:
"customer id="reset"" => "Cust " ,
我也尝试用单引号替换双引号,但总是在同一行出现错误
我也尝试过从第三方软件拨打电话,拨打电话正确,结果符合预期
结构应该是
<customer id='reset'>
myCust
</customer>
谢谢果酱
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.