PHP Soap - Can't import schema

二次信任 提交于 2019-12-23 03:07:49

问题


I want to connect to a Soap server, but I have the error :

SOAP-ERROR: Parsing Schema: can't import schema from 'http://domain.com:80/services.xsd

I took a look on other questions, and I have my "allow_url_open" to ON, I use SOAP_1_1 and OpenSSL is enabled. Something is weird, the URL to my SOAP server is :

https://domain.com/services?WSDL

And in the error, there is no more "https", but only "http" on port 80. I tried :

wget https://domain.com/services?WSDL

And it works. I have an XML file with all my services. But, using PHP and :

try
{
    $client = new SoapClient('https://domain.com/services?wsdl',         
    array(
        "trace" => 1,
         "soap_version" => SOAP_1_1
   ));                 
}
catch (SoapFault $e)
{
   var_dump($e);
}

I have the "Parsing Schema: can't import schema" error. Do I need to configure something else on my PHP ? I am using Nginx and PHP-FPM 5. Thanks.


回答1:


http://domain.com:80/services.xsd

Are you able to access above link in your browser?

No, I guess.Similarly it is not accessible through your code also. This schema location must be defined in your wsdl i.e.

 https://domain.com/services?WSDL

You can add those elements from schema into wsdl. You can follow this approach to get rid of it.

http://weblogs.thinktecture.com/cweyer/2007/05/improving-wcf-interoperability-flattening-your-wsdl.html


来源:https://stackoverflow.com/questions/21432426/php-soap-cant-import-schema

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!