You are on page 1of 16

Introduction to Web Services

Shiva Chitta

March 26th, 2014

2000 West Park Drive


Westborough MA 01581 USA
Phone: 508 389 7300 Fax: 508 366 9901

The entire contents of this document are subject to copyright with all rights reserved. All copyrightable text and graphics, the selection, arrangement and presentation of
all information and the overall design of the document are the sole and exclusive property of Virtusa.

Copyright © 2010 Virtusa Corporation. All rights reserved


Agenda

• Motivation
• History
• Web service Big picture
• Web Service Components

2 © Virtusa Corporation ● Confidential


Motivation & History

• Why Web services evolved ?


– To solve
1. Interoperability
Earlier distributed systems suffered from interoperability issues because each vendor
implemented its own on-wire format for distributed object messaging.
2. Firewall traversal
Web Services use HTTP as a transport protocol and most of the firewalls allow access
though port 80 (HTTP), leading to easier and dynamic collaboration
3. Complexity
Web Services is a developer-friendly service system.
Most of the above-mentioned technologies such as RMI, COM, and CORBA
involve a whole learning curve.

• What was there before Web services ?


- RPC, ORPC (DCOM, CORBA and JAVA RMI)

3 © Virtusa Corporation ● Confidential


What is a Web Service?

• Piece of software available over Internet


• Uses standardized (i.e., XML) messaging system
• More general definition: collection of protocols and standards used for
exchanging data between applications or systems

4 © Virtusa Corporation ● Confidential


Web Services Architecture

SOA(Service Oriented Architecture)

5 © Virtusa Corporation ● Confidential


Web Services Components

XML – eXtensible Markup Language – A uniform data


representation and exchange mechanism.

SOAP – Simple Object Access Protocol – A standard way for


communication.

UDDI – Universal Description, Discovery and Integration


specification – A mechanism to register and locate WS based
application.

WSDL – Web Services Description Language – A standard meta


language to described the services offered.

6 © Virtusa Corporation ● Confidential


SOAP

SOAP – Simple Object Access Protocol – A standard way for


communication.

7 © Virtusa Corporation ● Confidential


Web Service Big Picture

8 © Virtusa Corporation ● Confidential


Approaches to Build

• 1 Bottom-up approach
• 2 Top down approach

9 © Virtusa Corporation ● Confidential


Web Services Advantages

•Language interoperability (Programming language independent)

•Platform independent (Hardware and OS independent)

•Function reusability

•Firewall friendly

•Use of standardized protocols

•Stateless communication

10 © Virtusa Corporation ● Confidential


SOAP Request

POST /InStock HTTP/1.1


Host: www.stock.org
Content-Type: application/soap+xml; charset=utf-8 Content-Length: 150

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle=http://www.w3.org/2001/12/soap-encoding”>

<soap:Body xmlns:m="http://www.stock.org/stock">
<m:GetStockPrice>
<m:StockName>IBM</m:StockName>
</m:GetStockPrice>
</soap:Body>
</soap:Envelope>

11 © Virtusa Corporation ● Confidential


SOAP Response

HTTP/1.1 200 OK
Content-Type: application/soap; charset=utf-8
Content-Length: 126

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">

<soap:Body xmlns:m="http://www.stock.org/stock">
<m:GetStockPriceResponse>
<m:Price>34.5</m:Price>
</m:GetStockPriceResponse>
</soap:Body>
</soap:Envelope>

12 © Virtusa Corporation ● Confidential


Summary: SOAP vs. REST

• REST – clients submit requests to Web services as HTTP requests


• SOAP – clients submit request in form of XML document
• SOAP advantages:
– Widely used and supported
– Supports variety of protocols (network transfer, authentication, encryption)

• REST advantages:
– Simple, relies only on HTTP protocol
– Performance and reliability

• Many sites support both SOAP and RESTful interfaces


– Amazon.com, XEMBL from EBI

13 © Virtusa Corporation ● Confidential


Resources
• http://msdn.microsoft.com/webservices/unde
rstanding/webservicebasics/default.aspx
• http://www.w3schools.com/
• http://uddi.microsoft.com/Default.aspx
• http://www.developer.com/services/article.ph
p/2195981
• Many more on the web…

14 © Virtusa Corporation ● Confidential


Q&A?

15 © Virtusa Corporation ● Confidential


THANK YOU

16 © Virtusa Corporation ● Confidential

You might also like