Documente Academic
Documente Profesional
Documente Cultură
– Interoperability
– 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.
– Complexity
Service Provider
Service Registry
Service Consumer
The service provider publishes its service(s) to a service registry such as UDDI in
the form of a WSDL document.
The service requestor finds services for consumption via service registries and
this process is also called “service discovery.”
Once the service requestor has acquired the service information, it can attempt to
bind to the service and use it.
In order for someone to use your service they have to know about it.
To allow users to interact with a service you must publish a description of it’s interface
(methods & arguments).
Once you have published a description of your service you must have a host set up to
serve it.
A web server is often used to deliver services (although custom application – application
communication is also possible).
4.2. SOAP
4.2.1. Introduction
For Example:
Another Example
SOAP Request
Host: www.stock.org
<?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>
Response – in SOAP
HTTP/1.1 200 OK
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>
4.3. WSDL
4.3.1. Introduction
The service interface is defined in a service description expressed in WSDL. The
WSDL specification defines:
o What operations the service supports and the format of the messages that
are sent and received by the service.
o How the service is accessed - that is, the binding maps the abstract
interface onto a concrete set of protocols.
o Where the service is located. This is usually expressed as a URI (Universal
Resource Identifier).
The following figure illustrates the use of WSDL. At the left is a service provider.
At the right is a service consumer. The steps involved in providing and consuming
a service are:
<message name="GetStockPriceRequest">
<part name="stock" type="xs:string"/>
</message>
<message name="GetStockPriceResponse">
<part name="value" type="xs:string"/>
</message>
<portType name=“StocksRates">
<operation name=“GetStockPrice">
<input message=“GetStockPriceRequest"/>
<output message=“GetStockPriceResponse"/>
</operation>
</portType>
4.4.1. Introduction
4.4.4. Advantages
Making it possible to discover the right business from the millions currently online
Defining how to enable commerce once the preferred business is discovered
Reaching new customers and increasing access to current customers
Expanding offerings and extending market reach
Example for sending messages using web services
The next figure provides more detail on the messages sent using Web Services.
At the left of the figure is a fragment of the WSDL sent to the repository. It shows a
CustomerInfoRequest that requires the customer's account to object information.
Also shown is the CustomerInfoResponse that provides a series of items on customer
including name, phone, and address items.
5. At the right of this figure is a fragment of the WSDL being sent to the service consumer.
This is the same fragment sent to the repository by the service provider. The service
consumer uses this WSDL to create the service request shown above the arrow
connecting the service consumer to the service provider. Upon receiving the request, the
service provider returns a message using the format described in the original WSDL. That
message appears at the bottom of the figure.