Web method signature modified.

Discussion in 'ASP .Net Web Services' started by Raj, May 31, 2006.

  1. Raj

    Raj Guest

    Hi,
    We have set of web service method already consumed by out client. Now we
    require to add few input parameters (int/string type) to existing web method.

    How does this will affect existing consumer of the service??
    Please take this as urgent query.
    Thanks in advance
    -rajesh
     
    Raj, May 31, 2006
    #1
    1. Advertisements

  2. Raj

    Raj Guest

    Hi Gaurav,

    I tried with a test application with old proxy after modifying a web method
    to add a new parameter. It is still serving the request. It is not crashing.

    However I wish to know if it approved by MS to do?
    Moreover can we have overloaded web method?
    Thanks in advance
    -rajesh
     
    Raj, Jun 1, 2006
    #2
    1. Advertisements

  3. Raj

    Raj Guest

    HI Gaurav,
    Thanks for your reply first of all.
    See I haven't removed any parameter instead I have added one. Min occurance
    is 1 for int and 0 for string param and both I have tried and found it
    working.

    Only concern is whether this is suggest approach, as you're saying no, which
    is why I think the existing set of web methods should not get disturbed.

    Thanks once again
    -rajesh
     
    Raj, Jun 2, 2006
    #3
  4. Raj

    Raj Guest

    Hi Gaurabh,
    Thanks a lot for helping me out.
    Only thing i didn't get out of mail is last statement.

    You say "Infact, the recommended way is to be backward compatible. So, give
    the
    new method (method with new parameters) a new name -- in "operations"
    section."

    What do you mean my in "operations" section. can you pls explain in detail.
    I ping you a lot for this. Just last help for now.
    Thanks
    -rajesh
     
    Raj, Jun 2, 2006
    #4
  5. Raj

    Simon Hart Guest

    Hi Raj,

    My advice would be to overload your existing Web Method by using the
    MessageName property of the WebMethod attribute and refactor the other
    original Web Method so you avoid duplicating code.

    Simon.
     
    Simon Hart, Jun 3, 2006
    #5
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.