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