0

I have followed mulitple examples online but cannot seem to get the below to work. For all examples the following request will work:

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
    <Body>
        <Process xmlns="http://sample.namespace.com/service/2.19/">
            <!-- Optional -->
            <ActionARequest>
                <Id>"Test"</Id>
                <Name>"Test"</Name>
            </ActionARequest>
        </Process>
    </Body>
</Envelope>

However when I change this to have the soap tags it does not work.

<soap:Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <Process xmlns="http://sample.namespace.com/service/2.19/">
            <!-- Optional -->
            <ActionARequest>
                <Id>"Test"</Id>
                <Name>"Test"</Name>
            </ActionARequest>
        </Process>
    </soap:Body>
</soap:Envelope>

Is there a particular setting I am missing?

Startup.cs:

var transportBinding = new HttpTransportBindingElement();
            var textEncodingBinding = new TextMessageEncodingBindingElement(MessageVersion.Soap11, System.Text.Encoding.UTF8);
            var customBinding = new CustomBinding(transportBinding, textEncodingBinding);
            app.UseSoapEndpoint<ICallbackService>("/integration-service/v2_17/ActionA", customBinding, SoapSerializer.XmlSerializer);
DaveCore
  • 13
  • 3
  • 1
    Namespaces are important not their prefix, or their lack of. If it's already working, then what's wrong with the first example? – Bogdan Jun 28 '21 at 17:03
  • Thanks for your answer Bogdan, we are taking over a service that already exists so need to replicate the current request. – DaveCore Jul 15 '21 at 15:26

1 Answers1

0

In your second example:

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

should be:

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

See also: What are XML namespaces for?

Bogdan
  • 23,890
  • 3
  • 69
  • 61