• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

soap:encodingStyle Attribute issue ?

 
Sim Kim
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

Where this attribute soap:encodingStyle can appear ?

SOAP 1.2 specifies :
The encodingStyle attribute information item MAY appear on the following:

1. A SOAP header block (see 5.2.1 SOAP header block).
2. A child element information item of the SOAP Body element information item (see 5.3.1 SOAP Body child Element) if that child is not a SOAP Fault element information item (see 5.4 SOAP Fault).
3. A child element information item of the SOAP Detail element information item (see 5.4.5.1 SOAP detail entry).
4. Any descendent of 1, 2, and 3 above.

Basic Profile 1.1 says :

SOAP encodingStyle Attribute

The soap:encodingStyle attribute is used to indicate the use of a particular scheme in the encoding of data into XML. However, this introduces complexity, as this function can also be served by the use of XML Namespaces. As a result, the Profile prefers the use of literal, non-encoded XML.

R1005 An ENVELOPE MUST NOT contain soap:encodingStyle attributes on any of the elements whose namespace name is "http://schemas.xmlsoap.org/soap/envelope/".

Please help me .

R1006 An ENVELOPE MUST NOT contain soap:encodingStyle attributes on any element that is a child of soap:Body.

R1007 An ENVELOPE described in an rpc-literal binding MUST NOT contain soap:encodingStyle attribute on any element that is a grandchild of soap:Body.
 
Chintan Rajyaguru
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me see if I can explain.

In general, encoding refers to how the data in the programming structure (e.g. int num = 5) is serialized into xml. SOAP 1.2 specification allows you to define the encoding style. The encoding style you choose to use is entirely up to you. You can theoretically define an encoding style called http://customstyles/simkim. As long as both web service provider and consumer understand this style they will be able to deserialize xml into their respective programming data structures. When you use the standard soap encoding as the encoding style, your encodingStyle attribute will be, http://schemas.xmlsoap.org/soap/encoding.

Now, to address your question, SOAP specification allows defining encoding style attribute at various levels. This means your header may use one encoding style and body may use another. However, Basic Profile (BP) explicitly prohibits the use of encoding style. Remember, the goal of BP is to clarify rules defined in the [wsdl, soap etc.] specifications and in some cases make them stricter. BP wants you to use literal style all the time and use schema to [de]serialize data in and out of XML. So, in your example, what BP is essentially saying is
1. SOAP message CANNOT contain encodingStyle attribute at envelope, header or body level
2. SOAP message cannot contain encodingStyle attribute at one level below the body level i.e. child of the body element
3. For RPC-literal binding, grand children of the body element will define input and output parameters of the web service operation. Since you are using RPC-literal, those grand children cannot be encoded in any style.

I hope this helps. Let me know if this still not clear. This stuff is extremely important for interoperability.
[ November 05, 2008: Message edited by: Chintan Rajyaguru ]
 
Sim Kim
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Chintan ! It was great explanation.
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SIM KIM can you please adjust your display name so that it contains mixed case characters like Sim Kim.

Thanks.
Amit
Javaranch Moderator.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic