Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

encodingStyle attribute value

 
vani venkat
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
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?
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
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.
    Best wishes!
     
    vani venkat
    Ranch Hand
    Posts: 142
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    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.
     
    Ivan Krizsan
    Ranch Hand
    Posts: 2198
    1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi!
    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.
    Best wishes!
     
    Dan Drillich
    Ranch Hand
    Posts: 1183
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Vani,

    Which style of WSDL should I use? explains the subject very well.

    Regards,
    Dan
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic