За последние 24 часа нас посетили 17202 программиста и 1693 робота. Сейчас ищут 1033 программиста ...

PHP-SOAP: Ошибка при использовании Document-style WSDL

Тема в разделе "Прочие вопросы по PHP", создана пользователем storozhilov, 2 апр 2008.

  1. storozhilov

    storozhilov Активный пользователь

    С нами с:
    2 апр 2008
    Сообщения:
    1
    Симпатии:
    0
    Здравствуйте! Возникла проблема с использованием SOAP-модуля PHP. Почему-то при использовании Document-style WSDL (авторитетные люди именно его рекомендуют к использованию) возникает ошибка приблизительного вида:

    Код (Text):
    1. PHP Fatal error:  Uncaught SoapFault exception: [SOAP-ENV:Client] Method
    2. 'parameters' not implemented: method name or namespace not recognized in
    3. /usr/home/illy/Programming/SOAP/PHP/document_style_wsdl/web_service_client.php:5
    4. Stack trace:
    5. #0 [internal function]: SoapClient->__call('initUserSession', Array)
    6. #1 /usr/home/illy/Programming/SOAP/PHP/document_style_wsdl/web_service_client.php(5):
    7. SoapClient->initUserSession(1, 'vasya_pupkin', 'password')
    8. #2 {main}
    9.   thrown in
    10. /usr/home/illy/Programming/SOAP/PHP/document_style_wsdl/web_service_client.php on line
    При использовании RPC-style WSDL (НЕ рекомендован) все отрабатывает нормально. Сам WSDL, вроде, нормальный, т.к. библиотека gSOAP, с помощью которой реализованы SOAP-сервер и клиентские приложения, "проглатывает" его без проблем, да и на валидаторе прогоняется...

    Может кто сталкивался?

    Собственно текст программы:

    PHP:
    1. <?php
    2.  
    3. ini_set('soap.wsdl_cache_enabled', '0');
    4. $client = new SoapClient("web_service.wsdl");
    5. $uuid = $client->initUserSession(1, 'vasya_pupkin', 'password');
    6.  
    7. ?>
    WSDL:

    Код (Text):
    1. <?xml version="1.0"?>
    2. <wsdl:definitions name="WebService"
    3.     targetNamespace="http://soap.webservice.com/soapd/web_service.wsdl"
    4.     xmlns:tns="http://soap.webservice.com/soapd/web_service.wsdl"
    5.     xmlns:islxsd="http://soap.webservice.com/soapd/web_service.xsd"
    6.     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    7.     xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    8.     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    9.   <wsdl:types>
    10.     <xsd:schema targetNamespace="http://soap.webservice.com/soapd/web_service.xsd"
    11.       xmlns:tns="http://soap.webservice.com/soapd/web_service.xsd"
    12.       xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
    13.       xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance">
    14.       <!-- Common types: -->
    15.       <xsd:simpleType name="UUIDDataType">
    16.         <xsd:restriction base="xsd:string">
    17.           <xsd:pattern value="[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}"/>
    18.         </xsd:restriction>
    19.       </xsd:simpleType>
    20.    
    21.       <xsd:simpleType name="EntityIDDataType">
    22.         <xsd:restriction base="xsd:int">
    23.           <xsd:minInclusive value="0" />
    24.         </xsd:restriction>
    25.       </xsd:simpleType>
    26.  
    27.       <xsd:complexType name="EntityIDRequestDataType">
    28.         <xsd:complexContent>
    29.           <xsd:restriction base="xsd:anyType">
    30.             <xsd:sequence>
    31.               <xsd:element name="uuid" type="tns:UUIDDataType" />
    32.               <xsd:element name="id" type="tns:EntityIDDataType" />
    33.             </xsd:sequence>
    34.           </xsd:restriction>
    35.         </xsd:complexContent>
    36.       </xsd:complexType>
    37.  
    38.       <!-- Custom types -->
    39.       <xsd:complexType name="LoggedErrorsDataType">
    40.         <xsd:complexContent>
    41.           <xsd:restriction base="xsd:anyType">
    42.             <xsd:sequence>
    43.               <xsd:element name="id" type="tns:EntityIDDataType" />
    44.               <xsd:element name="message" type="xsd:string" />
    45.             </xsd:sequence>
    46.           </xsd:restriction>
    47.         </xsd:complexContent>
    48.       </xsd:complexType>
    49.  
    50.       <xsd:complexType name="ArrayOfLoggedErrorsDataType">
    51.         <xsd:complexContent>
    52.           <xsd:restriction base="xsd:anyType">
    53.             <xsd:sequence>
    54.               <xsd:element name="errors" minOccurs="0" maxOccurs="unbounded" nillable="false" type="tns:LoggedErrorsDataType" />
    55.             </xsd:sequence>
    56.           </xsd:restriction>
    57.         </xsd:complexContent>
    58.       </xsd:complexType>
    59.  
    60.       <xsd:complexType name="InitUserSessionRequestDataType">
    61.         <xsd:complexContent>
    62.           <xsd:restriction base="xsd:anyType">
    63.             <xsd:sequence>
    64.                 <xsd:element name="loginTypeID" type="tns:EntityIDDataType" />
    65.                 <xsd:element name="login" type="xsd:string" />
    66.                 <xsd:element name="password" type="xsd:string" />
    67.             </xsd:sequence>
    68.           </xsd:restriction>
    69.         </xsd:complexContent>
    70.       </xsd:complexType>
    71.  
    72.       <!-- Elements: -->
    73.       <xsd:element name="faultResponse" type="tns:ArrayOfLoggedErrorsDataType" />  
    74.       <xsd:element name="initUserSessionRequest" type="tns:InitUserSessionRequestDataType"/>
    75.       <xsd:element name="initUserSessionResponse" type="tns:UUIDDataType"/>
    76.      
    77.     </xsd:schema>
    78.   </wsdl:types>
    79.  
    80.   <wsdl:message name="faultResponse">
    81.     <wsdl:part name="parameters" element="islxsd:faultResponse"/>
    82.   </wsdl:message>
    83.  
    84.   <wsdl:message name="initUserSessionRequest">
    85.     <wsdl:part name="parameters" element="islxsd:initUserSessionRequest"/>
    86.   </wsdl:message>
    87.  
    88.   <wsdl:message name="initUserSessionResponse">
    89.     <wsdl:part name="parameters" element="islxsd:initUserSessionResponse"/>
    90.   </wsdl:message>
    91.  
    92.   <wsdl:portType name="WebServiceInterface">
    93.     <wsdl:operation name="initUserSession">
    94.       <wsdl:input message="tns:initUserSessionRequest"/>
    95.       <wsdl:output message="tns:initUserSessionResponse"/>
    96.       <wsdl:fault message="tns:faultResponse" name="initUserSessionFault"/>
    97.     </wsdl:operation>
    98.   </wsdl:portType>
    99.  
    100.   <wsdl:binding name="WebServiceSoapHttpBinding" type="tns:WebServiceInterface">
    101.     <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    102.     <wsdl:operation name="initUserSession">
    103.       <soap:operation soapAction="http://soap.webservice.com/soapd"/>
    104.       <wsdl:input>
    105.         <soap:body use="literal" namespace="http://soap.webservice.com/soapd/web_service.wsdl"/>
    106.       </wsdl:input>
    107.       <wsdl:output>
    108.         <soap:body use="literal" namespace="http://soap.webservice.com/soapd/web_service.wsdl"/>
    109.       </wsdl:output>
    110.       <wsdl:fault name="initUserSessionFault">
    111.         <soap:fault use="literal" namespace="http://soap.webservice.com/soapd/web_service.wsdl"/>
    112.       </wsdl:fault>
    113.     </wsdl:operation>
    114.   </wsdl:binding>
    115.  
    116.   <wsdl:service name="WebServiceService">
    117.     <wsdl:documentation>SOAP-service</wsdl:documentation>
    118.     <wsdl:port name="WebServiceEndpoint" binding="tns:WebServiceSoapHttpBinding">
    119.       <soap:address location="http://soap.webservice.com:8080/cgi-bin/soapd"/>
    120.     </wsdl:port>
    121.   </wsdl:service>
    122.  
    123. </wsdl:definitions>
     
  2. melok

    melok Активный пользователь

    С нами с:
    20 ноя 2008
    Сообщения:
    29
    Симпатии:
    0
    И у меня такая же беда, кто знает подскажите!