Last post Jan 12, 2015 12:54 AM by Shawn - MSFT
Jan 09, 2015 10:39 AM|olybobo|LINK
When are web services needed.
Jan 09, 2015 10:41 AM|Siva Krishna Macha|LINK
Web services are needed whenever you would like to expose some functionality (services or API) should be exposed over network, say, over HTTP or HTTPS, that can be consumed by other clients.
Jan 09, 2015 10:45 AM|olybobo|LINK
What do you mean expose some functionality. I am still a bit confused.
Jan 09, 2015 11:03 AM|Siva Krishna Macha|LINK
For example, you want to offer addition functionality to clients over http.
int Add( int input1, int input2)
Webservice will have the code:
int Add (int input1, int input2)
// Write any complex business logic you may have
int c = input1 + input2;
The clients will not know the actual logic you performed on the server. They will just invoke the Add method by passing the parameters in some message format (say XML) by hitting your Webservice url. The webservice will then run the piece of code on the
server and will return the result back to the client.
The clients will consume the methods exposed by webservices over HTTP (using XML as the standard message format).
You can go through this MSDN article for more information:
Jan 12, 2015 12:54 AM|Shawn - MSFT|LINK
For why do we use web services, you could refer to the following information:
Here are the benefits of using Web Services
A Web service is a unit of managed code that can be remotely invoked using HTTP, that is, it can be activated using HTTP requests. So, Web Services allows you to expose the functionality of your existing code over the network. Once it is exposed on the
network, other application can use the functionality of your program.
Web Services allows different applications to talk to each other and share data and services among themselves. Other applications can also use the services of the web services. For example VB or .NET application can talk to java web services and vice versa.
So, Web services is used to make the application platform and technology independent.
Web Services uses SOAP over HTTP protocol for the communication, so you can use your existing low cost internet for implementing Web Services. This solution is much less costly compared to proprietary solutions like EDI/B2B. Beside SOAP over HTTP, Web Services
can also be implemented on other reliable transport mechanisms like FTP etc.
For more information, you could refer to: