2014-09-02 40 views
0

我需要使用之前準備的Zend_Soap_Server和WSDL運行SOAP服務器。然而,當我試圖做到這一點的:SOAP-ERROR:解析架構:無法導入架構。命名空間不能與封閉模式'targetNamespace'匹配

$server = new Zend_Soap_Server($wsdlUrl); 
$server->setClass('Logic_WebService_Test'); 
$server->handle(); 

我得到一個錯誤:

SOAP-ERROR: Parsing Schema: can't import schema. Namespace must not match the enclosing schema 'targetNamespace'

這裏是我的WSDL:

<?xml version="1.0" encoding="UTF-8"?> 
<!-- version="1.0" comment="" --> 
<wsdl:definitions 
    targetNamespace="http://ws.orange.pl/mo-sms-service-ws" 
    xmlns="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:apachesoap="http://xml.apache.org/xml-soap" 
    xmlns:impl="http://ws.orange.pl/mo-sms-service-ws" 
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> 
     ------------------------------------------------------------------------------------------ 
     Contract interface documentation 
     -------------------------------- 
     Document release: V1_0 
     Author (entity): AMG.net 
     Creation date: 01/10/2013 
     Description: mo-sms-service-ws contract interface 
     ------------------------------------------------------------------------------------------ 
     Changes history 
     --------------- 
     Version Date Comments 
     V1_0 01/10/2013 WSDL contract 
     ------------------------------------------------------------------------------------------ 
    </wsdl:documentation> 
    <wsdl:types> 
     <schema elementFormDefault="qualified" 
      targetNamespace="http://ws.orange.pl/mo-sms-service-ws" 
      xmlns="http://www.w3.org/2001/XMLSchema" 
      xmlns:apachesoap="http://xml.apache.org/xml-soap" 
      xmlns:impl="http://ws.orange.pl/mo-sms-service-ws" 
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> 

      <xsd:import namespace="http://ws.orange.pl/mo-sms-service-ws" /> 
      <element name="DeliverShortMessage"> 
       <complexType> 
        <sequence> 
         <element name="sms" type="impl:SMSMessage" /> 
        </sequence> 
       </complexType> 
      </element> 
      <element name="DeliverShortMessageResponse"> 
       <complexType> 
        <sequence> 
         <element name="DeliverShortMessageReturn" nillable="true" type="xsd:boolean" /> 
        </sequence> 
       </complexType> 
      </element> 
      <element name="DeliverNotification"> 
       <complexType> 
        <sequence> 
         <element name="sms" type="impl:SMSNotification" /> 
        </sequence> 
       </complexType> 
      </element> 
      <element name="DeliverNotificationResponse"> 
       <complexType> 
        <sequence> 
         <element name="DeliverNotificationReturn" nillable="true" type="xsd:boolean" /> 
        </sequence> 
       </complexType> 
      </element> 
     </schema> 
     <schema elementFormDefault="qualified" 
      targetNamespace="http://ws.orange.pl/mo-sms-service-ws" 
      xmlns="http://www.w3.org/2001/XMLSchema" 
      xmlns:apachesoap="http://xml.apache.org/xml-soap" 
      xmlns:impl="http://ws.orange.pl/mo-sms-service-ws" 
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> 
      <complexType name="SMSMessage"> 
       <sequence> 
        <element name="recipient" minOccurs="1" type="xsd:string" /> 
        <element name="recipientAlias" minOccurs="0" type="xsd:string" /> 
        <element name="originator" minOccurs="1" type="xsd:string" /> 
        <element name="content" minOccurs="1" type="xsd:string" /> 
        <element name="transactionId" minOccurs="1" type="xsd:string" /> 
        <element name="timestamp" minOccurs="0" type="xsd:string" /> 
       </sequence> 
      </complexType> 
      <complexType name="SMSNotification"> 
       <sequence> 
        <element name="recipient" minOccurs="0" type="xsd:string" /> 
        <element name="originator" minOccurs="0" type="xsd:string" /> 
        <element name="transactionId" minOccurs="1" type="xsd:string" /> 
        <element name="status" minOccurs="1" type="xsd:string" /> 
        <element name="errorCode" minOccurs="0" type="xsd:string" /> 
        <element name="content" minOccurs="0" type="xsd:string" /> 
        <element name="timestamp" minOccurs="0" type="xsd:string" /> 
       </sequence> 
      </complexType> 
     </schema> 
    </wsdl:types> 
    <wsdl:message name="DeliverShortMessageRequest"> 
     <wsdl:part element="impl:DeliverShortMessage" name="parameters" /> 
    </wsdl:message> 
    <wsdl:message name="DeliverShortMessageResponse"> 
     <wsdl:part element="impl:DeliverShortMessageResponse" name="parameters" /> 
    </wsdl:message> 
    <wsdl:message name="DeliverNotificationRequest"> 
     <wsdl:part element="impl:DeliverNotification" name="parameters" /> 
    </wsdl:message> 
    <wsdl:message name="DeliverNotificationResponse"> 
     <wsdl:part element="impl:DeliverNotificationResponse" name="parameters" /> 
    </wsdl:message> 
    <wsdl:portType name="MoSmsServiceWs"> 
     <wsdl:operation name="DeliverShortMessage"> 
      <wsdl:input message="impl:DeliverShortMessageRequest" name="DeliverShortMessageRequest" /> 
      <wsdl:output message="impl:DeliverShortMessageResponse" name="DeliverShortMessageResponse" /> 
     </wsdl:operation> 
     <wsdl:operation name="DeliverNotification"> 
      <wsdl:input message="impl:DeliverNotificationRequest" name="DeliverNotificationRequest" /> 
      <wsdl:output message="impl:DeliverNotificationResponse" name="DeliverNotificationResponse" /> 
     </wsdl:operation> 
    </wsdl:portType> 
    <wsdl:binding name="MoSmsServiceWsSoapBinding" type="impl:MoSmsServiceWs"> 
     <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> 
     <wsdl:operation name="DeliverShortMessage"> 
      <wsdlsoap:operation soapAction="http://ws.orange.pl/mo-sms-service-ws/delivershortmessage" /> 
      <wsdl:input name="DeliverShortMessageRequest"> 
       <wsdlsoap:body use="literal" /> 
      </wsdl:input> 
      <wsdl:output name="DeliverShortMessageResponse"> 
       <wsdlsoap:body use="literal" /> 
      </wsdl:output> 
     </wsdl:operation> 
     <wsdl:operation name="DeliverNotification"> 
      <wsdlsoap:operation soapAction="http://ws.orange.pl/mo-sms-service-ws/delivernotification" /> 
      <wsdl:input name="DeliverNotificationRequest"> 
       <wsdlsoap:body use="literal" /> 
      </wsdl:input> 
      <wsdl:output name="DeliverNotificationResponse"> 
       <wsdlsoap:body use="literal" /> 
      </wsdl:output> 
     </wsdl:operation> 
    </wsdl:binding> 
    <wsdl:service name="MoSmsService"> 
     <wsdl:port binding="impl:MoSmsServiceWsSoapBinding" name="MoSmsServiceWs"> 
      <wsdlsoap:address location="http://ws.orange.pl/mo-sms-service-ws/MoSmsServiceWs" /> 
     </wsdl:port> 
    </wsdl:service> 
</wsdl:definitions> 

這有什麼錯呢?

回答

0

的問題是在這條線:

<xsd:import namespace="http://ws.orange.pl/mo-sms-service-ws" /> 

它嘗試導入遞歸命名空間「http://ws.orange.pl/mo-sms-service-ws」,這是不是由PHP處理。

在我的情況下,刪除這條線幫助。