[英]php soap question: howto create custom namespace
I am using php soap. 我正在使用php soap。 I can't get my soap body to include a custom namespace.
我无法让我的肥皂正文包含自定义名称空间。 Here is an example of what I want:
这是我想要的示例:
<?xml version='1.0' encoding='UTF8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<tns:MyCall xmlns:tns="my.sx"><tns:op>getStuff</tns:op><tns:args />
</tns:MyCall>
</soapenv:Body>
</soapenv:Envelope>
I can't get the namespace called tns to appear inside the body, or the elements op and args. 我无法获得名为tns的名称空间显示在主体内部,或元素op和args。
Can anyone suggest how this is done? 谁能建议这是怎么做的?
My code looks like: 我的代码如下:
$client = CreateSoapClient();
try{
$result = $client->__soapCall(
'MyCall',
array(), // no params
array(
'uri' => 'urn:Myurn',
'soapaction' => 'urn:Myurn'
));
?>
You need to define your namespace in your WSDL. 您需要在WSDL中定义名称空间。 It's probably easiest to just use the Zend WSDL autogenerator, which I believe will let you set the namespace.
仅使用Zend WSDL自动生成器可能是最简单的,我相信它可以让您设置名称空间。 Let me know if you need more information.
如果您需要更多信息,请与我们联系。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.