duanmu2941 2010-01-31 02:48
浏览 149
已采纳

php soap问题:如何创建自定义命名空间

I am using 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.

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'
));
?>
  • 写回答

1条回答 默认 最新

  • dongmeng1868 2010-01-31 22:41
    关注

    You need to define your namespace in your WSDL. It's probably easiest to just use the Zend WSDL autogenerator, which I believe will let you set the namespace. Let me know if you need more information.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!