[XML/XSL] WSDL Response

Dieses Thema im Forum "Webentwicklung" wurde erstellt von Hanskopf, 7. Dezember 2009 .

Schlagworte:
  1. 7. Dezember 2009
    WSDL Response

    Hi,
    hab hier für die Uni ne Aufgabe mit der ich aber nichts anfangen kann. Hab nie was mit XML gemacht :/

    Aufgabe:
    In our example, the method myMethod did have an empty response. Now, we want to change it to return the two values a=y^x and b=x+1.
    Extend the WSDL description in the file myservice.wsdl.xml accordingly.


    myservice.wsdl.xml

    <?xml version="1.0"?>
    <definitions name="MyService"
    xmlns:myNS="http://example.com/myservice.wsdl"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    targetNamespace="http://example.com/myservice.wsdl">

    <types>
    <schema xmlns="http://www.w3.org/2000/10/XMLSchema"
    targetNamespace="http://example.com/myservice.wsdl">
    <element name="myMethod">
    <complexType>
    <sequence>
    <element name="x" type="xsd:int"/>
    <element name="y" type="xsd:float"/>
    </sequence>
    </complexType>
    </element>
    <element name="myMethodResponse"> <complexType/> </element>
    </schema>
    </types>

    <message name="myMethodRequest">
    <part name="parameters" element="myNS:myMethod"/>
    </message>

    <message name="myMethodResponse">
    <part name="parameters" element="myNS:myMethodResponse"/>
    </message>

    <portType name="MyPort">
    <operation name="myMethod">
    <input message="myNS:myMethodRequest"/>
    <output message="myNS:myMethodResponse"/>
    </operation>
    </portType>

    <binding name="MyServiceSOAPBinding"
    type="myNS:MyPort">
    <soap:binding style="document"
    transport="http://schemas.xmlsoap.org/soap/http/"/>
    <operation name="myMethod">
    <soap peration soapAction="http://example.com/myMethod"/>
    <input>
    <soap:body use="literal"/>
    </input>
    <output>
    <soap:body use="literal"/>
    </output>
    </operation>
    </binding>

    <service name="MyService">
    <port name="ServicePort" binding="MyServiceSOAPBinding">
    <soap:address location="http://example.com/myservice"/>
    </port>
    </service>

    </definitions>










    _________________________________________

    Reicht es dann <types> um die beiden ausgabevariabeln wie folgt zu ergänzen:

    <types>
    <schema xmlns="http://www.w3.org/2000/10/XMLSchema"
    targetNamespace="http://example.com/myservice.wsdl">
    <element name="myMethod">
    <complexType>
    <sequence>
    <element name="x" type="xsd:int"/>
    <element name="y" type="xsd:float"/>
    </sequence>
    </complexType>
    </element>
    <element name="myMethodResponse">
    <complexType>
    <sequence>
    <element name="a" type="xsd:float"/>
    <element name="b" type="xsd:int"/>
    </sequence>
    </complexType>
    </element>
    </schema>
    </types>





    Muss ich nirgendswo die genauen Ausgaben definieren also sowas wie: a=y^x und b=x+1 ?
     
  2. 8. Dezember 2009
    AW: WSDL Response

    Und sieht die SOAP response response dann wie folgt aus ?

    <soap:envelope>
    <soap:body>
    <myMethodResponse>
    <a><powequ> <integer>3</integer> <float>y</float> <rational>x</rational> </powequ></a>
    <b>x+1</b>
    </myMethodResponse>
    </soap:body>
    </soap:envelope>
     
  3. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.