Is it legal to have different SOAP namespaces/versions between the request and response?

10,136

Solution 1

Okay, the edited question does seem to have an answer: "It depends."

W3C: Version Transition From SOAP/1.1 to SOAP Version 1.2

Solution 2

Both namespaces are entirely valid (you can even navigate to each one to see the schema definition). It sounds as though the issue is with your Soap UI test utility and treating the response with the namespace from the request.

A service describes the request and response payload, and namespaces help to define that definition. While it seems bad form to mix/match these definitions between the two, it is still valid.

Even though the schemas get mixed between request and response, those are just helpers in interpreting request and response values.

Share:
10,136
Pops
Author by

Pops

Former Community Manager at Stack Exchange (August 2013-November 2017). My posts from before or after that time period (and, like, a bunch of the ones from during it, too) should not be considered "official" in any way. Joel: I have all these opinions ... and no outlet for them! Josh: Have you tried yelling them at the Internet? Joel: Almost exclusively! And yet problems still persist! -"The Grand Opining", HijiNKS ENSUE, by Joel Watson "On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question." -Charles Babbage Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law. -Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid

Updated on June 05, 2022

Comments

  • Pops
    Pops almost 2 years

    THIRD EDIT: I now believe that this problem is due to a SOAP version mismatch (1.1 request, 1.2 response) masquerading as a namespace problem. Is it illegal to mix versions, or just bad style? Am I completely out of luck if I can't change my SOAP version or the service's?

    SECOND EDIT: Clarified error message, and tried to reduce "tl;dr"-ness.

    EDIT: [Link deleted, not related]

    Using soapUI, I'm sending a request that starts with:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" ...
    

    and getting a response that starts with:

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" ...
    

    I know the service is getting the info, because processes down the line are working. However, my soapUI teststep fails. It has two active assertions: "SOAP Response" and "Not SOAP Fault." The failure marker is next to "SOAP Response," with the following message:

    line -1: Element Envelope@http://www.w3.org/2003/05/soap-envelope is not a valid Envelope@http://schemas.xmlsoap.org/soap/envelope/ document or a valid substitution.

    I have tried mixing and matching the namespace prefixes and schema URLs. Changing prefixes seems to have no effect; changing URLs causes a VersionMismatch error. I have also tried to use a substitution group, but that doesn't seem to be legal.