Saturday, May 3, 2014

Encoded vs. Literal & RPC vs Document WSDL Types

This article http://johnderinger.wordpress.com/2009/10/25/wsdl-binding-styles/ pretty much spells it out. The Takeaway is that Document Literal Wrapped makes the most sense because while staying WS-I compliant by having only one element under body, that element is the method name, so the method parameters, which in RPC style were separate messages, are wrapped in the method name (note "wrapped" actually refers to the fact that the method parameters are not shown in the WSDL message 'part' but "wrapped" or in other words exist implicitely by virtue of element reference to corresponding element of method in attached schema) in both the WSDL message and WSDL types schema under a complex type. Note, in Document Literal the complex type contained no method name neither did the actual soap message (the message as seen being sent by the client over the wire, not the portType/message WSDL elements) so the message could not be validated or dispatched properly.
So my take is:
RPC encoded - not JAX-WS compliant (must use JAX-RPC or AXIS)
RPC encoded and literal - both easily dispatched because method name is in soap mesage body, but soap message cannot be validated
Document literal - not easily dispatched because there's no method name in the soap message body -- the fact it can be validated doesn't mean much then
Document literal wrapped - best of both worlds: method name included in both soap message body and in type schema