PHP Soap-无法导入架构 [英] PHP Soap - Can't import schema
问题描述
我想连接到Soap服务器,但出现错误:
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
我查看了其他问题,并将"allow_url_open"设置为ON,我使用SOAP_1_1并启用了OpenSSL. 有点奇怪,我的SOAP服务器的URL是:
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
并且在错误中,端口80上不再有"https",而只有"http".我尝试了:
And in the error, there is no more "https", but only "http" on port 80. I tried :
wget https://domain.com/services?WSDL
它有效.我的所有服务都有一个XML文件.但是,使用PHP和:
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);
}
我出现解析架构:无法导入架构"错误.我需要在PHP上配置其他内容吗?我正在使用Nginx和PHP-FPM5.谢谢.
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.
推荐答案
http://domain.com:80/services.xsd
您可以在浏览器中访问以上链接吗?
Are you able to access above link in your browser?
不,我想.类似地,也无法通过您的代码访问它. 此架构位置必须在您的wsdl中定义,即
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
您可以将模式中的那些元素添加到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
这篇关于PHP Soap-无法导入架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!