Visual Studio WebMethod with specific SOAP format

T

titogarcia

Hi experts,

I need a Web Service with a specific SOAP format. Its SOAP request
and
response parameters must be XML elements with no nesting, for
example:


<soap:Body>
<MyMethod xmlns="http://tempuri.org/">
<input1>input1</input1>
<input2>input2</input2>
</MyMethod>
</soap:Body>


However, using Visual Studio 2005, I cannot see a way to build a Web
Service like that. I put for instance:


[WebMethod]
public Object MyMethod(Object input1, Object input2) {
Object output = new Object();
output.my_string = "Hello World";
return output;
}


public class Object
{
public string my_string;
}


But this builds a Web Service with nested elements inside the
request:
<soap:Body>
<MyMethod xmlns="http://tempuri.org/">
<input1>
<my_string>string</my_string>
</input1>
<input2>
<my_string>string</my_string>
</input2>
</MyMethod>
</soap:Body>


and inside the response:


<soap:Body>
<MyMethodResponse xmlns="http://tempuri.org/">
<MyMethodResult>
<my_string>string</my_string>
</MyMethodResult>
</MyMethodResponse>
</soap:Body>


Do you know how can I get this done with Visual Studio?


Thank you in advance and regards,
Tito
 

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,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top