File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes WSDL query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "WSDL query" Watch "WSDL query" New topic
Author

WSDL query

Mike Pandey
Ranch Hand

Joined: Dec 05, 2005
Posts: 62
Hi All,

Can I have a message declared for dicument style service with two parts say ABC1 & ABC2 each referring to 2 different top level elements from the types section.
<message name="ABCMessage">
<part name="ABC1" type="mh:topElem"/>
<part name="ABC2" type="mh:topElem"/>
</message>

If yes, let us say I want to use one of the message part as input in a operation getABC() and the part I want to use is ABC1
How do I specify the same in the below definition???
<portType name="saysomethng">
<operation name="getABC">
<input name="ip" message="mh:ABCMessage"/>
</operation>
</portType>

Please repond.

Thanks
Mike Pandey
Ranch Hand

Joined: Dec 05, 2005
Posts: 62
The part definition needs to be having name and element attributes in the below case. Apologize for that.

But can anybody pls anwer the query

Thanks.
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Originally posted by Mike Pandey:
The part definition needs to be having name and element attributes in the below case. Apologize for that.
Thanks.


To be BP compliant yes; however WSDL 1.1 makes no such restriction.

Can I have a message declared for document style service with two parts say ABC1 & ABC2 each referring to 2 different top level elements from the types section.


So something like:


According to Which style of WSDL should I use? you can - however in the vast majority of practical cases you would only have one part in the message for a document/literal messaging style.

When you use document/literal the operation name specified in the portType never appears in the SOAP envelope. This means that the message implies the operation. So often messages are designed with only one part so that the document type in the request implies the operation. If you have multiple parts in the message you create the more complicated scenario where document type combination and order in the request imply the operation.

This is why the Basic Profile requires:

5.3.1 Bindings and Parts

There are various interpretations about how many wsdl:part elements are permitted or required for document-literal and rpc-literal bindings and how they must be defined.

R2201 A document-literal binding in a DESCRIPTION MUST, in each of its soapbind:body element(s), have at most one part listed in the parts attribute, if the parts attribute is specified.

R2210 If a document-literal binding in a DESCRIPTION does not specify the parts attribute on a soapbind:body element, the corresponding abstract wsdl:message MUST define zero or one wsdl:parts.


So by extension a BP compliant document/literal WSDL should have at most one part definition per message. So:

Can I have a message declared for document style service with two parts


  • WSDL 1.1: Yes
  • BP 1.0a: Allowed but best avoid it if you follow the BP spirit. If the message it has multiple parts you have to select exactly one in the binding.


  • let us say I want to use one of the message part as input in a operation getABC() as input in a operation getABC() and the part I want to use is ABC1. How do I specify the same in the below definition???


    (PS: Having an operation name of "getABC" is downright confusing when you are only sending input)

    WSDL 1.1 lets you do this:

    and its even BP compliant because only one part is specified. However WSDL 1.1 allows you to specify multiple parts while BP doesn't. So if you are creating a BP compliant web service a different route is safer:


    Your may be interested in this old topic document Vs rpc message styles.
    Mike Pandey
    Ranch Hand

    Joined: Dec 05, 2005
    Posts: 62
    Thanks a lot!
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: WSDL query