Which style of WSDL should I use? (reship)


RPC/literal

The RPC/literal WSDL for this method looks almost the same as the RPC/encoded WSDL (see Listing 4). The use in the binding is changed from encoded to literal. That’s it.
Listing 4. RPC/literal WSDL for myMethod

<message name="myMethodRequest">
    <part name="x" type="xsd:int"/>
    <part name="y" type="xsd:float"/>
</message>
<message name="empty"/>

<portType name="PT">
    <operation name="myMethod">
        <input message="myMethodRequest"/>
        <output message="empty"/>
    </operation>
</portType>

<binding .../>
<!-- I won't bother with the details, just assume it's RPC/literal. -->

What about the SOAP message for RPC/literal (see Listing 5)? Here there is a bit more of a change. The type encodings have been removed.
Listing 5. RPC/literal SOAP message for myMethod

<soap:envelope>
    <soap:body>
        <myMethod>
            <x>5</x>
            <y>5.0</y>
        </myMethod>
    </soap:body>
</soap:envelope>

A note about xsi:type and literal use

Although in normal circumstances xsi:type does not appear in a literal WSDL’s SOAP message, there are still cases when type information is necessary and it will appear — in polymorphism, for instance. If the API expects a base type and an extension instance is sent, the type of that instance must be provided for proper deserialization of the object.

Here are the strengths and weaknesses of this approach:

Strengths

Weaknesses

What about the document styles? Do they help overcome this weakness?

Pages: previous pagenext page

By javafuns on July 7, 2009 at 16:40 · Views: 572 · Permalink
Categorized in: SOA · Tagged with: , , , , ,
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Leave a Reply


  • Highest Rated

  • My PicasaPhotos

    9a6297314aa2120aeac4afc9.jpg

    IMG_0680.JPG

    IMG_0676.JPG

  • RSS My del.icio.us

  • My RSS