0

I have a method that is calling a web service. When this web service is called, the following method is called:

[System.Web.Services.Protocols.SoapDocumentMethodAttribute(
    "http://mydomain.com/services/DoSomething", 
    RequestNamespace = "http://mydomain.com/services", 
    ResponseNamespace = "http://mydomain.com/services", 
    Use = System.Web.Services.Description.SoapBindingUse.Literal, 
    ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlElementAttribute("MyResponse")]

public MyResponse DoSomethingr(MyRequest myRequest)
{
    object[] results = this.Invoke("DoSomething", new object[] { myRequest});
    return ((MyResponse)(results[0]));
}

When this method is called, I've noticed that the XML includes the following:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <!-- XML --!>
  </soap:Body>
</soap:Envelope>

How do I remove the <soap:> wrappers from my XML?

3
  • 2
    Why do you want to remove those XML namespaces prefixes?? Those are part of the SOAP standard used to call web services - don't tamper with them, otherwise your SOAP call might not work anymore.... Commented Nov 29, 2010 at 17:39
  • If you don't want the <soap:> wrappers then avoid using a SoapDocumentMethodAttribute. Commented Nov 29, 2010 at 17:43
  • if you remove the <soap : > stuff, then you're not using SOAP. Better to use WCF, a different .NET programming model, if you don't want soap web services. Commented Dec 5, 2010 at 22:46

1 Answer 1

3

I wouldn't. Soap is a standard protocol for publishing services and accessing remote data. Without it the remote server won't understand your request.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.