XmlNode parameter to web service

Discussion in 'ASP .Net Web Services' started by Stephen Ahn, Sep 20, 2006.

  1. Stephen Ahn

    Stephen Ahn Guest

    Using VS.NET 2003,

    Given a web service proxy method like this :

    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://testing.com/atest/Test",
    Use=System.Web.Services.Description.SoapBindingUse.Literal,
    ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
    public void
    Test([System.Xml.Serialization.XmlElementAttribute(Namespace="http://testing.com/atest")]
    System.Xml.XmlNode doc) {
    this.Invoke("Test", new object[] {doc});
    }

    generates a soap request something like this :

    <?xml version="1.0" encoding="utf-8"?>
    <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>
    <doc xmlns="http://testing.com/atest">
    <root xmlns="ns">
    <data xmlns="a">one</data>
    <data xmlns="a">two</data>
    </root>
    </doc>
    </soap:Body>
    </soap:Envelope>

    Is it possible to change the web proxy method in some way, so that the
    generated request does not have the "doc" element ? i.e. so that the
    generated request looks like this :

    <?xml version="1.0" encoding="utf-8"?>
    <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>
    <root xmlns="ns">
    <data xmlns="a">one</data>
    <data xmlns="a">two</data>
    </root>
    </soap:Body>
    </soap:Envelope>

    (This is due to the way in which a third party web service expects the
    request).

    TIA,
    Stephen
    Stephen Ahn, Sep 20, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mahesh Devjibhai Dhola

    Problem in deriving custome class from XmlNode

    Mahesh Devjibhai Dhola, Oct 15, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    484
    Mahesh Devjibhai Dhola
    Oct 15, 2004
  2. Replies:
    1
    Views:
    363
  3. Brad Quinn

    Adding an XmlNode parameter to the HelloWorld WebMethod

    Brad Quinn, Jul 31, 2003, in forum: ASP .Net Web Services
    Replies:
    4
    Views:
    128
    Lucien
    Aug 2, 2003
  4. arc

    XmlNode in Web Services...

    arc, Nov 12, 2003, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    124
    Tomas Restrepo \(MVP\)
    Nov 13, 2003
  5. John Bailo

    XmlDocument Web method returns type XmlNode

    John Bailo, Oct 22, 2004, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    274
    Dan Rogers
    Nov 15, 2004
Loading...

Share This Page