Forums Register Login

Mock exam question: SOAP doubt

+Pie Number of slices to send: Send
SOAP Message :
<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
<soap:Body>
<p:Process xmlns:p='http://example.org/Operations'>
<m:Envelope xmlns:m='http://schemas.xmlsoap.org/soap/envelope/'>
.......
</m:Envelope>
</p:Process>
</soap:Body>
</soap:Envelope>
What is going to happen when a Web service (whose implementation conforms to WS-I Basic Profile 1.0a) receives the following SOAP message?
Ans:
  • Generate a fault for the SOAP Message
  • Process the message for the SOAP Message

  • What will be the answer?

    Actually I'm not sure whether a soap:Header or soap:Body can have child elements which belongs to this 'http://schemas.xmlsoap.org/soap/envelope/' namespace. Can we have an 'soap:Envelope' within 'soap:Body' or 'soap:Body' within another 'soap:Body'? Is there any restrictions on that? While searching BP rules, I only got this,
    R1003 A RECEIVER MUST accept fault messages that have any number of qualified or unqualified attributes, including zero, appearing on the detail element. The namespace of qualified attributes can be anything other than "http://schemas.xmlsoap.org/soap/envelope/".

    Is there any other restrictions like this? Please clarify.
    +Pie Number of slices to send: Send
    Hi!
    From the WS-I Basic Profile:

    R1009 An ENVELOPE MUST NOT contain Processing Instructions.


    The envelope you enclosed contains a processing instruction, thus a fault will be generated.
    Best wishes!

    Edit: This is wrong, see below!
    +Pie Number of slices to send: Send
    Please, take a look at the correct example related to R1011:

    CORRECT:

    <soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' >
    <soap:Body>
    <p:Process xmlns:p='http://example.org/Operations' >
    <m:Data xmlns:m='http://example.org/information' >
    Here is some data with the message
    </m:Data>
    </p:Process>
    </soap:Body>
    </soap:Envelope>



    Best Regards
    Adam
    +Pie Number of slices to send: Send
    Hi!
    I certainly was tricked! :-)
    XML processing instructions begin with <? and ends with ?>.
    Thus, in the question, there are no processing instructions.
    Reference: http://www.w3.org/TR/REC-xml/#sec-pi
    Best wishes!
    +Pie Number of slices to send: Send
    So is the message valid?
    <soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
    <soap:Body>
    <p:Process xmlns:p='http://example.org/Operations'>
    <m:Envelope xmlns:m='http://schemas.xmlsoap.org/soap/envelope/'>
    ..............
    Will not this line[marked in bold] cause a problem? Can we have child elements under <soap:Body> which belongs to 'http://schemas.xmlsoap.org/soap/envelope/' namespace?

    +Pie Number of slices to send: Send
    Hi again!
    I find this related to the SOAP Body and this question in the Basic Profile:


    R9981 An ENVELOPE MUST have exactly zero or one child elements of the soap:Body element.
    R1014 The children of the soap:Body element in an ENVELOPE MUST be namespace qualified.
    R2712 A document-literal binding MUST be serialized as an ENVELOPE with a soap:Body whose child element is an instance of the global element declaration referenced by the corresponding wsdl:message part.


    But I do not find anything saying that a child element of the SOAP Body cannot belong to the namespace of the SOAP Envelope.
    As far as I understand, you can declare the element being the contents of the SOAP Body to be a wrapper element that contains only an entry of anyType, which would allow the wrapper element to contain any legal XML contents, including other SOAP messages.
    Would be very interesting to hear if anyone finds anything that forbids usage such as this in the BP etc.
    Best wishes
    when your children are suffering from your punishment, tell your them it will help them write good poetry when they are older. Like this tiny ad:
    a bit of art, as a gift, that will fit in a stocking
    https://gardener-gift.com


    reply
    reply
    This thread has been viewed 1885 times.
    Similar Threads
    Do grandchildren of Soap:body element need to be fully qualified?
    BP-compliant SOAP Envelope's namespace
    Doubt in soap:header
    how to set an attribute like SOAPAction in the Header?
    SOAP doubt: The Envelope element
    More...

    All times above are in ranch (not your local) time.
    The current ranch time is
    Apr 16, 2024 00:55:14.