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. Advertisements

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. Pratcp
    Replies:
    3
    Views:
    8,066
    Pratcp
    Dec 7, 2005
  2. Replies:
    1
    Views:
    445
  3. hocho888
    Replies:
    1
    Views:
    844
  4. Michael Averstegge
    Replies:
    0
    Views:
    4,517
    Michael Averstegge
    Jan 10, 2006
  5. Brad Quinn

    Adding an XmlNode parameter to the HelloWorld WebMethod

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

    XmlNode in Web Services...

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

    XmlDocument Web method returns type XmlNode

    John Bailo, Oct 22, 2004, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    379
    Dan Rogers
    Nov 15, 2004
  8. Leo Violette
    Replies:
    0
    Views:
    1,282
    Leo Violette
    Apr 17, 2009
Loading...