Web Service
Ali Kamandi kamandi@ce.sharif.edu Sharif University of Technology Internet Engineering (CE317) Spring 2007
Web Service Ali Kamandi kamandi@ce.sharif.edu Sharif University of - - PowerPoint PPT Presentation
Web Service Ali Kamandi kamandi@ce.sharif.edu Sharif University of Technology Internet Engineering (CE317) Spring 2007 Service Oriented Architecture (SOA) There is an increase trend for sharing resource/data both within companies and
Ali Kamandi kamandi@ce.sharif.edu Sharif University of Technology Internet Engineering (CE317) Spring 2007
2
within companies and among companies
divided into small services.
the dynamic, automated discovery and use.
can use these services.
3
Interoperability between different systems and
Clear and unambiguous description language Retrieval of the service
4
5
A Web Service is a software component
platform-independent, language-independent
Web Services can be used to realize service oriented
Web services are modular applications that can be
6
The Web technologies used:
XML (Extensible Markup Language) SOAP (Simple Object Access Protocol) allow
WSDL (Web Services Description Language) UDDI (Universal Description, Discovery, and
7
HTTP protocol facilitates Human-to-
There is an increasing demand for
HTTP is not adequate for more complex
8
Late 1999, Microsoft published SOAP an XML-
IBM supports SOAP early 2000. May 2000 W3C Note: SOAP 1.1. The term Web services was coined several months
March 2001 W3C Note: WSDL1.1 2002, UDDI 1.0 were also introduced
9
10
11
Your Web service will sit behind a Web server,
Support loosely coupled connections between
Works through existing proxies and firewalls. Can take advantage of HTTP authentication. Web services only receive and return XML. Provide a stateless model.
12
13
Every Web service has its home, where it lives. Its address is defined by a URI (URL). This address is often called an endpoint For exampe: http://localhost:6060/ChatService/
14
Web services are based on 3 main
SOAP WSDL (Web Services Description Language) UDDI (Universal Discovery, Description, and
15
16
17
18
Software reuse has always been limited by one
Web services let you reuse code along with the
Example: validating email address, city, zip
Building an application that aggregates the
19
Single Machine Applications Applications that need to communicate with others running on the same machine. In this case, it is almost always better to use a native API rather than a Web service because they require relatively little overhead. Homogeneous Applications on a LAN Homogenous applications running on the same machine
the same LAN.
20
Service Side
–Expects SOAP as input
Client Side
–Generates and sends SOAP
21
With Web services, you have a server and a client. It's comparable to the ordinary HTML-based
By contrast, with Web services there's an HTTP-
The SOAP server interprets the requests and then
22
The reply might consist of
a description of the server's available Web
data encapsulated in a well-formed XML
…
23
SOAP requests could
server
24
You can have different exchange scenarios
One-way message scenarios Request-response scenarios (when a request
…
25
What is SOAP?
Internet).
26
What is SOAP?
27
The SOAP envelope is analogous to the
It supplies information about the message:
data relating to the recipient and sender details about the message itself.
28
POST /InStock HTTP/1.1 Host: www.stock.org Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?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>
29
HTTP/1.1 200 OK Content-Type: application/soap; charset=utf-8 Content-Length: nnn <?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>
30
Language/Platform Independence Easy to use Is sent over HTTP
Which allows you to get around tricky issues like
…
31
functionality
request/response
32
XML Messaging (Individual) Service Description
33
34
UDDI defines the operation of a service registry:
Data structures for registering SOAP Access API Global/Private registry
35
The data captured within UDDI is divided into three main categories:
address.
company or the service offered. For example, this data may include industry, product, or geographic codes based on standard taxonomies.
and an address for invoking the Web service.
36
Web Services are described using WSDL
WSDL is an XML-based grammar for
37
It enables developers to describe a Web service's
When a Web service is first invoked, it replies with a
38
.NET’s web service infrastructure will
As extended IDL: WSDL allows tools to
39
40
portType
Abstract definition of a service (set
Multiple bindings per portType:
How to access it SOAP, JMS
Ports
Where to access it
41
!"# $% &' ( ' )( ' *' )*' +( ' ) +( ' ,*' ),*' +-' )+-' )'
42
defines
+( '
traditional programming language
programming language
43
<?xml version="1.0"?> <serviceDescription xmlns:s0="http://tempuri.org/" name="TerraService" targetNamespace="http://tempuri.org/" xmlns="urn:schemas-xmlsoap-org:sdl.2000-01-25"> <httpget xmlns="urn:schemas-xmlsoap-org:get-sdl-2000-01-25"> <service> <requestResponse name="GetPlaceList" href="http://207.46.235.37/terranet/terraservice.asmx/GetPlaceList"> <request> <param name="placeName"/> <param name="MaxItems"/> <param name="imagePresence"/> </request> <response> <mimeXml ref="s0:ArrayOfPlaceFacts"/> </response> </requestResponse> </service> </httpget> </serviceDescription>
44
The Proxy class is responsible for the following:
The proxy class can be generated automatically using
Client Proxy
RMI- IIOP JMS/ MQ SOAP/ HTTP
For More Information SOAP !" WSDL !" # UDDI