我有一个PHP Server。当一个(例如)python脚本询问WSDL时,它得到了正确的结果。WSDl确实导入了位于同一站点的某个位置的XSD。这也很好,因为python可以使用工厂来创建在导入的xsd中定义的类型。当使用client.service.ActionName()处理请求时,PHP脚本将启动。
PHP首先初始化自己的wsdl,然后在导入位于其服务器上的xsd时获得一个错误。
简短的问题:为什么python可以加载xsd导入,而php却不能加载?
这里有wsdl的开头:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:tns="http://---/webservices/2012-09/" xmlns:eba="http://---/schemas/1-0/" xmlns:xsd="http://www.w3.org/2001/XMLSchema/" targetNamespace="http://---/webservices/2012-09/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://---/webservices/2012-09/" elementFormDefault="qualified">
<xsd:import namespace="http://---/schemas/1-0/" schemaLocation="xsd/XSDName"/>
</xsd:schema>
</wsdl:types>这是xsd的开始:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="ElementName" type="ElementType">这是Python脚本:
url = 'http://---/wsdl&' + str(uuid.uuid1())
client = Client(url)
print client
wb = client.factory.create('ns0:MyType')
print wb
post_result = client.service.RequestFunction(wb)这是PHP脚本:
$soapServer = new SoapServer('http://---/wsdl'); // <-- fails here
$soapServer->setClass('SoapHandler');
$soapServer->handle(); 发布于 2013-10-09 13:50:34
有两个明显的区别:
https://stackoverflow.com/questions/18741009
复制相似问题