Problem :

A SOAP request message is encoded in XML.  The requestor can encode the
message either using SOAP-Encoding or Literal-XML-Encoding.  In both cases
the message carries the method name and parameters.   However, the
difference comes during the response.  If the message was encoded using
SOAP-Encoding, a tag containing string value is parsed and translated : '>'
would be translated to '&gt', '<' would be translated to '&lt' etc..  This
is undesirable because the clients can not make sense of '&lt' and '&rt' if
they are expecting XML tags.

Solution :

On the other hand if the request was encoded using 'literal-XML' encoding
style, SOAP expects Document Node for the parameters.  It is upto the soap
server to parse the Document Node and get the parameters.  While this may be
a slight inconvenient in coding, this offers great benefits for the SOAP
development :

Advantages :

1) In SOAP-encoding, parameters (if present) are mandatory.  In literal -
XML parameters are not mandatory.
2) In SOAP-encoding, parameters order is important.  In literal - XML it can
present anywhere.  We are free to require and not require any parameter.  So
the clients can send request very freely.
3) In SOAP-encoding, a string is parsed and translated, In literal - XML, it
is not.

Reply via email to