Php 分析架构时发生Soap错误:can';无法从意外的targetNamespace导入架构

Php 分析架构时发生Soap错误:can';无法从意外的targetNamespace导入架构,php,python,soap,Php,Python,Soap,我有一个PHP Soap服务器。 当(例如)pythonsuds脚本询问WSDL时,它会得到正确的结果。 WSDl确实导入了位于同一站点某处的XSD。 这也很顺利,因为python可以使用工厂创建在导入的xsd中定义的类型。 当使用client.service.ActionName()处理请求时,PHP脚本将启动 PHP首先初始化自己的wsdl,然后在导入位于其服务器上的xsd时出错 简短问题:为什么python可以加载xsd导入,而php不能 这里是wsdl的开头: <?xml vers

我有一个PHP Soap服务器。 当(例如)pythonsuds脚本询问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>
这是PHP脚本:

$soapServer = new SoapServer('http://---/wsdl'); // <-- fails here
$soapServer->setClass('SoapHandler'); 
$soapServer->handle(); 
$soapServer=新的soapServer('http://---/wsdl'); // setClass('SoapHandler');
$soapServer->handle();

有两个明显的区别:

  • 在PHP中,您使用的是SoapServer而不是SoapClient
  • 在Python中,URL与在PHP中不同-您添加了一些userid或类似于/wsdl&+str(uuid.uuid1())与/wsdl的内容
  • 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)
    
    $soapServer = new SoapServer('http://---/wsdl'); // <-- fails here
    $soapServer->setClass('SoapHandler'); 
    $soapServer->handle();