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 encodingStyle attribute value 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 "encodingStyle attribute value" Watch "encodingStyle attribute value" New topic
Author

encodingStyle attribute value

vani venkat
Ranch Hand

Joined: Nov 21, 2006
Posts: 142
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?


SCJP 1.4, SCWCD 1.5
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
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

    Joined: Nov 21, 2006
    Posts: 142

    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

    Joined: Oct 04, 2006
    Posts: 2198
        
        1
    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

    Joined: Jul 09, 2001
    Posts: 1180
    Vani,

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

    Regards,
    Dan

    William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: encodingStyle attribute value