XmlNode parameter to web service

S

Stephen Ahn

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top