在 Nusoap PHP 中添加命名空间前缀
我正在使用 nusoap v 1.123,我正在尝试在生成的 nusoap 请求中添加前缀 urn
这是我所期望的
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:mnop:acceptor:contract">
<soapenv:Header>
<urn:authenticationHeader>
<urn:name>abctest</urn:name>
<urn:userid>dddd</urn:userid>
<urn:pass>errerere</urn:pass>
</urn:authenticationHeader>
</soapenv:Header>
,这就是代码生成的
<SOAP-ENV:Header>
<authenticationHeader>
<name>abctest</urn:name>
<userid>dddd</urn:userid>
<pass>errerere</urn:pass>
</authenticationHeader>
</SOAP-ENV:Header>
$header = new SoapHeader($wsdl, 'authenticationHeader',$headerParam);
$soapAction='urn:mnop:acceptor:contract';
$client = new nusoap_client($wsdl);
$client->setHeaders($headerParam);
$data=$client->call('myoperation',$bodyParam,$namespace,$soapAction,null,null,'document', 'literal');
urn 前缀缺失的 内容SOAP-ENV: 需要替换为soapenv: ,请告诉我解决这个问题。
谢谢
I'm using nusoap v 1.123, I'm trying to add the prefixes urn in my generated request of nusoap
This is what I am expecting
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:mnop:acceptor:contract">
<soapenv:Header>
<urn:authenticationHeader>
<urn:name>abctest</urn:name>
<urn:userid>dddd</urn:userid>
<urn:pass>errerere</urn:pass>
</urn:authenticationHeader>
</soapenv:Header>
and this is what the code is generating
<SOAP-ENV:Header>
<authenticationHeader>
<name>abctest</urn:name>
<userid>dddd</urn:userid>
<pass>errerere</urn:pass>
</authenticationHeader>
</SOAP-ENV:Header>
$header = new SoapHeader($wsdl, 'authenticationHeader',$headerParam);
$soapAction='urn:mnop:acceptor:contract';
$client = new nusoap_client($wsdl);
$client->setHeaders($headerParam);
$data=$client->call('myoperation',$bodyParam,$namespace,$soapAction,null,null,'document', 'literal');
the urn prefix is missing and SOAP-ENV: need to be replaced with soapenv: , kindly tell me to resolve this issue.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这就是我解决这个问题的方法
this is how I solved this problem
解决这个问题,必须配置nusoap参数
添加全局命名空间
$client->namespaces['tem'] = "http://tempuri.org/";
并为元素添加本地命名空间
解决
Solved this problem, nusoap parameters must be configured
add global name space
$client->namespaces['tem'] = "http://tempuri.org/";
and add local namespace for elements
Resolve