Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / September 2003

Tip: Looking for answers? Try searching our database.

Changing the default elementName for the return value of a Web Method

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Atul Agarwal - 11 Sep 2003 11:54 GMT
Hello

Lets say I have a WebMethod with the following Attributes

[SoapRpcMethod()]   
[WebMethod(MessageName="MyAction",Description="MyAction")]
public short method()
{
  return 1;
}

The WSDL for the above Method has the following
<message name="MyActionSoapIn">
</message>
<message name="MyActionSoapout">
 <part name="MyActionResult" type="s:short" />
</message>

What do I need to do so that name="MyActionResult" changes to say
name="MyResult" in the above WSDL ?

I tried specifying [return:XmlElement(ElementName="MyResult")]
but that did not help.

Thank you.

Atul Agarwal
Parker Zhang [MSFT] - 12 Sep 2003 10:18 GMT
Hi,

When using RPC instead of Document, I don't think you are able to change
the return element name.

Please refer to
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconcustomizingsoapina
spnetwebserviceswebserviceclients.asp.

If you have any Qs, please reply to this post.

--
Parker Zhang
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
atul agarwal - 24 Sep 2003 02:06 GMT
Hi

Actual if you use SoapElement instead of XmlElement you CAN
change the return Element Name !!!

Thanks

Atul Agarwal
atulapt@vsnl.com

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.