O'Reilly logo

A Programmer's Guide to .NET by Alexei Fedorov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

15.1. Web service protocols

To communicate with web services, we can use HTTP-GET, HTTP-POST or SOAP protocols. HTTP-GET and HTTP-POST use HTTP as an underlying protocol and encode parameters as name/value pairs in the HTTP request. The GET method appends data to the URL of the server-side script, while POST methods encode name/value pairs in the body of the HTTP request message. The following examples show HTTP-GET and HTTP-POST requests and responses for the web service (for a description of this service see under Creating a web service later in this chapter). First is HTTP-GET:

GET /WebServices/wsdemo.asmx/GreetUser?Name=string HTTP/1.1 
Host: localhost 
HTTP/1.1 200 OK 
Content-Type: text/xml; charset=utf-8 
Content-Length: length <?xml version="1.0" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required