Web Services Tutorial – Part 1

Web Services are typically services offered through web via exchange of XML data. A client makes a request call and server provides a response for the service call. This does not have a GUI it is mainly used for exchanging business logic. This is similar to the services provided by Object Management Group’s Common Object Request Broker Architecture (CORBA), Microsoft’s Distributed Component Object Model (DCOM), Sun’s Java Remote Method Invocation (RMI)

The Web Services uses the following components/protocols

XML – eXtensible Mark-up Language, used for defining the request and response data.

SOAP – Simple Object Access Protocol, a platform independent protocol used by the client and sever to make a Remote Procedure Call (RPC)

WSDL – Web Services Definition Language, describes the service and its operations

UDDI – Universal Description Discovery and Integration, for listing the web services.


Key Features of Web Services

  1. Can be accessed via Web
  2. Interoperable – Services can be accessed irrespective of the programming language or Operating System
  3. XML Communication – It is simple and less time consuming.
  4. Supports loosely coupled connections.

To get a better understanding of a web service, we can look at the stock quote web service available here (http://www.webservicex.net/stockquote.asmx)

This web service provides share price for a given stock quote. To see the Web Service Definition Language the URL needs to appended with ?wsdl


WSDL for stock quote web service looks as shown below

Stock Quote Service WSDL

The WSDL provides the services description like the operations details(GetQuote) provided by the Stock Quote Service. Let us check this with by making a request for stock symbol GOOG (Google)

SOAP Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET/">

SOAP Response

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <GetQuoteResponse xmlns="http://www.webserviceX.NET/">
               <AnnRange>247.30 - 591.19</AnnRange>
               <Name>Google Inc.</Name>

The above the SOAP Request makes a service call for the stock symbol GOOG and SOAP Response provides the stock details such as Last Price, Low, high, Change, Previous Close etc.

In Category: Programming

Ravi Shankar

A Software developer and blogger who is always looking to provide technical help to the wider community.

Show 0 Comments
No comments yet. Be the first.

Leave a Comment

Get your free copies of the following tech guides by joining the Digital Answers mailing list.