Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Visual Studio WebMethod with specific SOAP format

Reply
Thread Tools

Visual Studio WebMethod with specific SOAP format

 
 
titogarcia@gmail.com
Guest
Posts: n/a
 
      02-22-2007
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

 
Reply With Quote
 
 
 
 
Mariano Omar Rodriguez
Guest
Posts: n/a
 
      02-23-2007
You could use wsdl.exe in order to generate the class and service.

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is Visual Studio 2005 complict with Visual Studio 2003 rockdale ASP .Net 1 08-23-2006 07:20 PM
Should I write Visual studio 2005 or Visual studio 2003 MCSD =?Utf-8?B?VmlqYXk=?= Microsoft Certification 14 06-30-2006 09:05 AM
Is Visual Studio Team System and Visual Studio Foundation Server are same?. Thirumalai ASP .Net 0 05-22-2006 08:48 AM
visual studio .net 2003 verses visual studio .net 2002 wh ASP .Net 2 01-16-2004 04:54 PM



Advertisments