За последние 24 часа нас посетили 52630 программистов и 1803 робота. Сейчас ищут 819 программистов ...

Wsdl

Тема в разделе "PHP для новичков", создана пользователем AniMEshKa, 31 авг 2009.

  1. AniMEshKa

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

    С нами с:
    4 сен 2007
    Сообщения:
    151
    Симпатии:
    0
    Адрес:
    Минск
    Добрый день! Помогите пожалуйста разобраться с WSDL
    Необходимо сгенерировать ключ, передавая в фукнцию параметры

    LicenseKey generateLicenseKey( String fname, String lname, String email, Calendar expiryDate )
    пишу на пхп4. посоветовали использовать nusoap..
    в результате подключения файла и передачи ему значений показывает ошибку Response not of type text/xml: text/plain
    получается нмкакого значения не возвращает?!
    Подскажите что делать
    Спасибо заранее!!
    Вот код
    PHP:
    1. require_once('nusoap.php');
    2. $client = new soapclient('http://localhost/samples/LeafNetsRegLicensingWebService.wsdl');
    3. $err = $client->getError();
    4. if ($err) {
    5.     echo '<p><b>Ошибка в конструкторе класса: ' . $err . '</b></p>';
    6. }
    7. $result = $client->call('generateLicenseKey', array('fname' => 'Elena', 'lname' => 'Volk','email' => [email='anime@mail.ru]'anime@mail.ru[/email]','expiryDate' => '20100106'));
    8.  
    9. if ($client->fault) {
    10.    echo '<p><b>Сбой: ';
    11.    print_r($result);
    12.    echo '</b></p>';
    13. } else {
    14.    $err = $client->getError();
    15.    if ($err) {
    16.        echo '<p><b>Ошибка: ' . $err . '</b></p>';
    17.    } else {
    18.        print_r($result);
    19.    }
    20. }
    wsdl:
    HTML:
    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <wsdl:definitions targetNamespace="http://url.net:8080/axis/services/LeafNetsRegLicensingWebService" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://url.net:8080/axis/services/LeafNetsRegLicensingWebService" xmlns:intf="http://url.net:8080/axis/services/LeafNetsRegLicensingWebService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="urn:com.leafnets.ds" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    3. <!--WSDL created by Apache Axis version: 1.4
    4. Built on Apr 22, 2006 (06:55:48 PDT)-->
    5.  <wsdl:types>
    6.   <schema targetNamespace="urn:com.leafnets.ds" xmlns="http://www.w3.org/2001/XMLSchema">
    7.    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
    8.    <complexType name="LicenseKey">
    9.     <sequence>
    10.      <element name="createdDate" nillable="true" type="xsd:dateTime"/>
    11.      <element name="email" nillable="true" type="xsd:string"/>
    12.      <element name="expiryDate" nillable="true" type="xsd:dateTime"/>
    13.      <element name="fname" nillable="true" type="xsd:string"/>
    14.      <element name="id" nillable="true" type="xsd:int"/>
    15.      <element name="lname" nillable="true" type="xsd:string"/>
    16.      <element name="str" nillable="true" type="xsd:string"/>
    17.     </sequence>
    18.    </complexType>
    19.   </schema>
    20.  </wsdl:types>
    21.  
    22.    <wsdl:message name="generateLicenseKeyRequest">
    23.  
    24.       <wsdl:part name="in0" type="xsd:string"/>
    25.  
    26.       <wsdl:part name="in1" type="xsd:string"/>
    27.  
    28.       <wsdl:part name="in2" type="xsd:string"/>
    29.  
    30.       <wsdl:part name="in3" type="xsd:dateTime"/>
    31.  
    32.    </wsdl:message>
    33.  
    34.    <wsdl:message name="generateLicenseKeyResponse">
    35.  
    36.       <wsdl:part name="generateLicenseKeyReturn" type="tns1:LicenseKey"/>
    37.  
    38.    </wsdl:message>
    39.  
    40.    <wsdl:portType name="LeafNetsRegLicensingWebService">
    41.  
    42.       <wsdl:operation name="generateLicenseKey" parameterOrder="in0 in1 in2 in3">
    43.  
    44.          <wsdl:input message="impl:generateLicenseKeyRequest" name="generateLicenseKeyRequest"/>
    45.  
    46.          <wsdl:output message="impl:generateLicenseKeyResponse" name="generateLicenseKeyResponse"/>
    47.  
    48.       </wsdl:operation>
    49.  
    50.    </wsdl:portType>
    51.  
    52.    <wsdl:binding name="LeafNetsRegLicensingWebServiceSoapBinding" type="impl:LeafNetsRegLicensingWebService">
    53.  
    54.       <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    55.  
    56.       <wsdl:operation name="generateLicenseKey">
    57.  
    58.          <wsdlsoap:operation soapAction=""/>
    59.  
    60.          <wsdl:input name="generateLicenseKeyRequest">
    61.  
    62.             <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://url.net:8080/axis/services/LeafNetsRegLicensingWebService" use="encoded"/>
    63.  
    64.          </wsdl:input>
    65.  
    66.          <wsdl:output name="generateLicenseKeyResponse">
    67.  
    68.             <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://url.net:8080/axis/services/LeafNetsRegLicensingWebService" use="encoded"/>
    69.  
    70.          </wsdl:output>
    71.  
    72.       </wsdl:operation>
    73.  
    74.    </wsdl:binding>
    75.  
    76.    <wsdl:service name="LeafNetsRegLicensingWebServiceService">
    77.  
    78.       <wsdl:port binding="impl:LeafNetsRegLicensingWebServiceSoapBinding" name="LeafNetsRegLicensingWebService">
    79.  
    80.          <wsdlsoap:address location="http://url:8080/axis/services/LeafNetsRegLicensingWebService"/>
    81.  
    82.       </wsdl:port>
    83.  
    84.    </wsdl:service>
    85.  
    86. </wsdl:definitions>
    87.  
    [/php]