Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > PHP: Libraries > Помогите составить WSDL


Автор: tishaishii 29.7.2012, 13:58
WSDL:
Код

<definitions
    name="XXX-XXX-Encoder"
    targetNamespace="http://192.168.1.35/Package/Package"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:control="http://192.168.1.35/Package/Package"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:soapenv="http://schemas.xmlsoap.org/wsdl/envelope/"
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://192.168.1.35/Package/Package"
elementFormDefault="qualified" attributeFormDefault="qualified">
        <element name="login-Type">
            <simpleType>
                <element name="login" type="string"/>
            </simpleType>
        </element>
        <element name="password-Type">
            <simpleType>
                <element name="password" type="string"/>
            </simpleType>
        </element>
        <element name="login-Request-Type">
            <complexType>
                <all>
                    <element name="login" type="string"/>
                    <element name="password" type="string"/>
                </all>
            </complexType>
        </element>
        <element name="login-Response-Type">
            <complexType>
                <all>
                    <element name="errorCode" type="control:status" nillable="true"/>
                    <element name="error" type="string" nillable="true"/>
                    <element name="ticket" type="control:uuid" nillable="false"/>
                </all>
            </complexType>
        </element>
    </schema>

    <message name="loginMessageRequest">
        <part name="login" element="control:login-Type"/>
        <part name="password" element="control:password-Type"/>
    </message>
    <message name="loginMessageResponse">
        <part name="login" element="control:login-Response-Type"/>
    </message>

    <portType name="XXX-XXX-Encoding-Port-Type">
        <operation name="login">
            <documentation><![CDATA[Авторизация через паспорт, по аналогии с авторизацией агентов]]></documentation>
            <input message="control:loginMessageRequest"/>
            <output message="control:loginMessageResponse"/>
        </operation>
    </portType>
    <binding name="XXX-XXX-Binding" type="control:XXX-XXX-Encoding-Port-Type">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="login">
            <soap:operation soapAction="http://192.168.1.35/Package/Package#login"/>
            <input>
                <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
            </input>
            <output>
                <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
            </output>
        </operation>
    </binding>
    <service name="XXX-XXX-Service">
        <documentation>XXX web-service</documentation>
        <port name="XXX-XXX-Port" binding="control:XXX-XXX-Binding">
            <soap:address location="http://192.168.1.35/soap"/>
        </port>
    </service>
</definitions>


Код PHP:
Код
<?php
    $client = new SoapClient ( 'http://192.168.1.35:80/get/wsdl.xml' ) ;
    $client -> login(
        array(
            'login'     => 'test' ,
            'password'  => 'test'
        )
    ) ;
?>


Вывод:
Код
PHP Fatal error:  Uncaught SoapFault exception: [soap:Client]
SOAPAction shall match 'uri#method' if present (got 'http://192.168.1.35/Package/Package#login', expected '#login'


Как сделать так, чтобы expected было не "#login", а "http://192.168.1.35/Package/Package#login"?

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)