php - 传递参数的php soap调用问题
问题描述
我创建了这个 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>
谢谢果酱
推荐阅读
- javascript - 如何将 settimeout 与 vue.js 观察者一起使用?
- java - 使精灵出现半秒左右然后消失
- javascript - 使用 Google Apps 脚本根据来自 Google 表格的值禁用日期选择器中的日期
- angular - 打字稿静态只读
- c# - 如何将数据集的数据绑定到列表视图?
- python - 按照 MVC 模式创建一个 Django 项目?
- c# - 在c#中合并datagridview中的列
- python - 如何在一些想要的字母之后提取字符串?仅使用 python 2.0 和 numpy 和 pandas
- elasticsearch - 在kibana汇总作业中获取给定间隔的连续时间戳
- jquery - select2 占位符显示组文本和子项