5

When testing a SOAP web service with SoapUI, the tool generates the following soap envelope:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
                  xmlns:v2="http://xmlns.mydomain.com/sales/schema/quotation/v2">
  <soapenv:Header/>
  <soapenv:Body>
    <v2:AddUpdateQuotationRequest>
      <v2:UserId>UserId</v2:UserId>
      <v2:PublicQKey>8de6cf8d-ea38-434d-a636-aac3a1c45999</v2:PublicQKey>
    </v2:AddUpdateQuotationRequest>
  </soapenv:Body>
</soapenv:Envelope>

but when I add a reference to the web service in Visual Studio and test the web service, the soap envelope is missing the namespace and has the following format:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <AddUpdateQuotationRequest>
      <UserId>UserId</UserId>
      <PublicQKey>8de6cf8d-ea38-434d-a636-aac3a1c45999</PublicQKey>
    </AddUpdateQuotationRequest>
  </s:Body>
</s:Envelope>

I know that accordingly to this article it is possible to add the namespace after the soap message is created by implententing IClientMessageInspector.

With that said, here are my two questions:

  1. Why is the soap envelope generated from SoapUI different than the one generated with Visual Studio?
  2. Is there any other/easier way to add the namespace to the soap message other then implementing IClientMessageInspector as explained in the aforementioned link?
DevNow
  • 71
  • 1
  • 1
  • 8

0 Answers0