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

Discussion in 'ASP .Net Web Services' started by Atul Agarwal, Sep 11, 2003.

  1. Atul Agarwal

    Atul Agarwal Guest

    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
     
    Atul Agarwal, Sep 11, 2003
    #1
    1. Advertising

  2. 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.
     
    Parker Zhang [MSFT], Sep 12, 2003
    #2
    1. Advertising

  3. Atul Agarwal

    atul agarwal Guest

    Hi

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

    Thanks

    Atul Agarwal



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    atul agarwal, Sep 24, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QmVu?=
    Replies:
    1
    Views:
    6,017
    Elliot Rodriguez
    May 19, 2006
  2. C Gillespie
    Replies:
    3
    Views:
    413
    Peter Hansen
    Mar 22, 2005
  3. Greenhorn
    Replies:
    15
    Views:
    830
    Keith Thompson
    Mar 6, 2005
  4. Rui Maciel
    Replies:
    19
    Views:
    1,480
    Daniel Pfeiffer
    Apr 7, 2010
  5. What is '$(elementname)'

    , Aug 25, 2006, in forum: Javascript
    Replies:
    3
    Views:
    87
    Trond Michelsen
    Aug 25, 2006
Loading...

Share This Page