locked
About web service. RRS feed

  • Question

  • [WebMethod]
    public int Add(int a, int b)
    {
      return a + b;
    }
    [WebMethod]
    public float Add(float a, float b)
    {
    return a + b;
    }
    
    


    Hello, Hi although I used web service a lot of times, but to be honest,I still can't clearly figure out the real meaning of "web service"
    From the above code, does it mean the calculation on the server side then it will be called from client side?

    It is a silly question but please don't copy and paste the definition from the textbook, please use plain and easily understandable language. Thanks,

    Thursday, September 8, 2011 2:00 PM

Answers

  • If you want do communication over the WEB, you shlould prefer web services. Its like an assembly, it doesnt expose actual functionality.

    All code executes on server side.

    Consider your deployment server in South Africa. Some functionality already has been devloped, but has not been exposed. If you need to use the existing funtionality, wrap all functionality in web service. It will get exposed through WSDL and you can easily reuse in your application.

    Hope this helps.

     

     


    Pravin Arote, MCTS - Web Technologies If reply answers your question, Please mark as Answer :)
    • Proposed as answer by Pravin S Arote Friday, September 9, 2011 6:28 AM
    • Marked as answer by ardmore Friday, September 9, 2011 12:51 PM
    Friday, September 9, 2011 6:28 AM

All replies

  • You should not use "WebMethod" for new web service development. See WCF.
    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects
    Thursday, September 8, 2011 5:48 PM
    Moderator
  • If you want do communication over the WEB, you shlould prefer web services. Its like an assembly, it doesnt expose actual functionality.

    All code executes on server side.

    Consider your deployment server in South Africa. Some functionality already has been devloped, but has not been exposed. If you need to use the existing funtionality, wrap all functionality in web service. It will get exposed through WSDL and you can easily reuse in your application.

    Hope this helps.

     

     


    Pravin Arote, MCTS - Web Technologies If reply answers your question, Please mark as Answer :)
    • Proposed as answer by Pravin S Arote Friday, September 9, 2011 6:28 AM
    • Marked as answer by ardmore Friday, September 9, 2011 12:51 PM
    Friday, September 9, 2011 6:28 AM
  • Yes You are right. Your code run on server based in client request.

    The major advantage you got here is interoperability. i.e say a java application want to do the calculation which is already writen by you than he can call your web service with out rewriting above code again.

     


    Lingaraj Mishra
    Friday, September 9, 2011 8:49 AM