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 Document Style Web Service Message Definitions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Document Style Web Service Message Definitions" Watch "Document Style Web Service Message Definitions" New topic
Author

Document Style Web Service Message Definitions

Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1176
Good Day,

Ivan said the following -

Example of a message defined to be used with a document style web service. Note that a <part>
element inside a <message> element declares an element attribute.


Thus, a <part> element inside a <message> may declare a type attribute or an element attribute.
- When the <message> is to be used with an RPC web service, use the type attribute.
- When the <message> is to be used with a document style web service, use the element
attribute.
With document style web services, the BP mandates that each message have zero or one part.


I'm not clear why we can't use type instead of element in this case.



Regards,
Dan


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
A quick recap of what the WS-I BP 1.1 has to say about message definitions in Document/Literal and RPC/Literal bindings:

R2203 An rpc-literal binding in a DESCRIPTION MUST refer, in its soapbind:body element(s), only to wsdl:part element(s) that have been defined using the type attribute.


R2204 A document-literal binding in a DESCRIPTION MUST refer, in each of its soapbind:body element(s), only to wsdl:part element(s) that have been defined using the element attribute.

The WS-I BP 1.1, section 4.4.1, also contains a motivation for the above rules.
Briefly, the reason is because of a part defined using the type attribute cannot be nillable and must occur exactly once. This makes sense with RPC-type operations - the usually have a fixed number of parameters that always need to be present. Admitted, object references in method calls can be null, but it feels like an exception to me more than a rule.
Hope this sheds some light!


My free books and tutorials: http://www.slideshare.net/krizsan
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1176
Beautiful explanation - thanks a lot Ivan.
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1176
Ivan,

In the decorated WSDL document in the study guide you have an rpc styled document. Type is used in the two messages but the fault is an element. Is it correct?



Regards,
Dan
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
So it seems:
http://www.ws-i.org/Profiles/BasicProfile-1.1.html#Bindings_and_Faults
Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Document Style Web Service Message Definitions