Is it legal to have SOAP envelopes with different namespaces between the request and response?
        Posted  
        
            by Lord Torgamus
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Lord Torgamus
        
        
        
        Published on 2010-03-26T15:01:24Z
        Indexed on 
            2010/03/26
            15:03 UTC
        
        
        Read the original article
        Hit count: 443
        
I'm new to SOAP and web services, and I'm getting an error I don't understand. Using soapUI, I'm sending the following request:
<soapenv:Envelope  
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"  
    xmlns:doc="http://myproj.mycompany.com">  
  <soapenv:Header/>  
  <soapenv:Body>...
and getting this response:
<soap:Envelope  
    xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
  <soap:Body>...
I know the service is getting the info, because things are happening properly down the line. 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.
So far, I have tried modifying the URLs and namespaces of the messages to match each other, and adding the following line:
<soapenv:Envelope
    xmlns:soapenv="http://w3.org/2003/05/soap-envelope"
    substitutionGroup="http://schemas.xmlsoap.org/soap/envelope/"/>
Is this namespace mixing legal? Is my problem actually something else?
© Stack Overflow or respective owner