i have a basic doubt in encoding style attribute of soap messages. does it represent whether the message is sent using 4 message modes available? like RPC/literal. RPC/encoded. document/literal and document/encoded.
I have been going through SOAP chapter of RMH. Also by looking at encoding style attribute will be able to identify which messaging mode soap message is sent to receiver?
The encodingStyle attribute is used to indicate how data is encoded into XML when communicating with the web service in question.
Thus, it can tell you the last part (in bold) in Document/Literal or RPC/Encoded etc.
The encodingStyle attribute will not tell you:
Whether a web service is a Document or RPC web service.
What messaging mode (request-response, one-way etc) the web service uses.
Do note that the Basic Profile restricts the use of the encodingStyle attribute.
posted 10 years ago
Thank you Ivan. just to summrize RPC and Document are messaging styles and Encoded and Literal represent encoding style of messages. and encodingStyle attribute indicates whether it is Encoded or Literal.
some more questions.
1. when do we used encoded and when to use Literal. since encoded is not supported by BP, should we always use Literal? what are the trade offs.
2. is there any default value for encodingStyle attribue? i see that it is not mentioned in many SOAP request messages given in RMH.
SCJP 1.4, SCWCD 1.5
posted 10 years ago
No, strictly speaking you do not need to use the encodingStyle attribute. The BP restricts the use of the encodingStyle attribute, as you can see here: http://www.ws-i.org/Profiles/BasicProfile-1.1.html#SOAP_encodingStyle_Attribute To specify the encoding for the input and output of an operation, use the <soap:body> element and the attribute use, as described here: http://www.w3.org/TR/wsdl#_soap:body 1. Yes, literal should always be used. The trade off with encoded (as opposed to literal) is that you are more likely to encounter interoperability problems.
2. Again, don't use the encodingStyle attribute.