开发者

PHP SoapClient creating error: "Namespace must not match the enclosing schema"

开发者 https://www.devze.com 2023-03-08 18:25 出处:网络
I\'m getting \"Namespace must not match the enclosing schema\" error when trying to create SoapClient object. Code is simple:

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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消