doudeng3008 2011-05-26 13:29
浏览 87

PHP SoapClient创建错误:“命名空间必须与封闭模式不匹配”

I'm getting "Namespace must not match the enclosing schema" error when trying to create SoapClient object. Code is simple:

<?php $client = new \SoapClient('http://www.server.com/Service?wsdl');

How can I create object by ignoring this error?

  • 写回答

1条回答 默认 最新

  • dqp21271 2011-05-26 13:38
    关注

    I'm not sure what the WSDL looks like, so it's a bit hard to tell if the error can be avoided. However, you can switch to creating a SoapClient using non WSDL mode:

    $client = new SoapClient(null, array('location' => "http://localhost/soap.php",
                                     'uri'      => "http://test-uri/"));
    

    Where location and uri are described as:

    An array of options. If working in WSDL mode, this parameter is optional. If working in non-WSDL mode, the location and uri options must be set, where location is the URL to request and uri is the target namespace of the SOAP service.

    Source: http://www.php.net/manual/en/soapclient.soapclient.php

    评论

报告相同问题?

悬赏问题

  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口