You are on page 1of 34

WEB SERVICES

J.Amirtharaj Solomon
jamirtha@covansys.com
Technology Group
WEB SERVICES
The Web Services fundamental
Architecture
Core technologies:
SOAP
UDDI
WSDL
Tools and Resources
What are Web
Servi ces?
A Web service represents a unit of
business, application, or system
functionality that can be accessed
over the Web.
Eg.Business Information with
rich content
❚ airline schedules
❚ stock quotes
❚ credit check
Web Servi ces

Eg.
Transactional Web Services for
B2B or B2C
❚ airline reservations
❚ rental car agreements
❚ purchase order
Web Servi ces

Characteristics
❚ It is accessible over the Web.
❚ It provides an interface that can be
called from another program.
❚ It is registered and can be located
through a Web service registry.
❚ It communicates using messages
over standard Web protocols.
Web Se rvi ces
funda mental
Arch ite cture
Web Services

• Publishing services uses the Universal


Description, Discovery and Integration
(UDDI).
• Locating services uses a combination of
UDDI and the Web Services Description
Language (WSDL).
• Binding to services leverages WSDL and
the Simple Object Access Protocol
(SOAP).
Foundation for Web Services

Publish and Discover Services: UDDI


Formal Service Descriptions: WSDL
Service Interactions: SOAP
Universal Data Format: XML
Ubiquitous Communications: Internet
Broad Industry Support, Simple Process
What is SOAP ?

❚ SOAP is a protocol specification for invoking


methods on servers, services, components and
objects. SOAP codifies the existing practice of
using XML and HTTP as a method invocation
mechanism.
❚The SOAP specification mandates a small
number of HTTP headers that facilitate
firewall/proxy filtering.
❚ The SOAP specification also mandates an XML
vocabulary that is used for representing
SOAP

SOAP 1.0: Userland, Microsoft,


DevelopMentor
❚ SOAP 1.0 was specific to COM and
HTTP
SOAP
SOAP 1.1 (April 23, 2000) -
includes
contributions from IBM and
Lotus
❚ substitutable Transport bindings (not
just HTTP)
❚ substitutable Language bindings (e.g.
Java)
❚ substitutable Data encodings
(pluggable)
SOAP
Request and Response
messages
❚ Request invokes a method on a
remote object
❚ Response returns result of running
the method
SOAP defines an "envelope"
❚ "envelope" wraps the message
itself
❚ message is a different vocabulary
SOAP - Headers
•Request
POST /foobar HTTP/1.1
Host: 209.110.197.12
Content-Type: text/plain
Content-Length: 12

•Response
200 OK
Content-Type: text/plain
Content-Length: 12
Connection: close
SOAP
SOAP Envelope Namespace
for wrapping messages
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
Method Call
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:createOrder xmlns:ns1="urn:ejbsessionbmp" SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodi
ng/">
<orderdetails xmlns:ns2="urn:xml-soap-createorderevent"
xsi:type="ns2:orderdetails">
<quantity xmlns:ns3="http://xml.apache.org/xml-soap"
xsi:type="ns3:Vector">
<item xsi:type="xsd:string">2</item>
<item xsi:type="xsd:string">4</item>
</quantity>
SOAP
<shipToCode xsi:type="xsd:string">1</shipToCode>
<custPartId xmlns:ns4="http://xml.apache.org/xml-soap"
xsi:type="ns4:Vector">
<item xsi:type="xsd:string">FrtLeftA</item>
<item xsi:type="xsd:string">RearLeftA</item>
</custPartId>
<orderType xsi:type="xsd:int">1</orderType>
<orderSeqNo xsi:type="xsd:string">11</orderSeqNo>
<custOrderReference
xsi:type="xsd:string">COR</custOrderReference>
<BCPCode xsi:type="xsd:string">1</BCPCode>
</orderdetails>
</ns1:createOrder>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
SOAP hides the service
implementation from requester

Soap Server

Web Server

?????????????????
Standard XML EJB CORBA COBOL
request/response
SOA P and Se cu rit y

❚ the standard authentication (e.g.,


SSL) mechanisms that are HTTP-
friendly can be used with SOAP
❚ firewalls can filter the soap
payload based on the HTTP header
information (interface and method
names ).
Wh at i s UD DI ?
❚ Universal Description, Discovery,
and Integration
❚ A project to speed interoperability
and adoption for web services
❚ Standards-based specifications for
service description and discovery
❚ Shared operation of a web-based
business registry
❚ Partnership among industry and
business leaders more than 70
companies have signed up so far
What Problems UDDI Solves?

A mid-sized

Broader manufacturer needs


to create 400 online

B2B
relationships with
customers, each with Describe
their own set of
standard and Services
protocols
A flower shop in
Smarter Australia wants to be
“plugged in” to every
Discover
Search marketplace in the
world, but doesn’t
Services
know how
A B2B marketplace Integrate
Easier cannot get catalog
data for relevant Them
Aggregation suppliers in its
industry, along with
Together
connections to
shippers, insurers, etc.
UDD I v1
Impl ementati on

UDDI Registry
❚ Programmatic descriptions of web
services
❚ Programming model, schema, and
platform agnostic
❚ Uses XML, HTTP, and SOAP
❚ Free on the Internet
UDDI Registry Entries
 Standards Bodies,
Agencies, Programmers,
Publishers register
specifications for their
Service Types

 Service providers
register precise
information about
themselves and their
Web services
•Business name
•General business description
•Contact info
Names, phone numbers,
fax numbers, web sites, etc.
•Known identifiers
List of unique identifiers for a business eg.D-
U-N-S, Thomas, domain name, stock ticker
symbol, other
Business categories
•3 base taxonomies in V1
Industry: NAICS (Industry codes - US Govt.)
Product/Services: UNSPSC (ECCMA)
Location: Geographical taxonomy (ISO
3166)
…easy extension in upcoming releases
New set of information businesses use
to describe how to “do e-commerce”
with them
•Nested model
Business process (functional)
Service specifications (technical)
Binding information (implementation)
•Programming/platform/
implementation agnostic
•Services can also be categorized
How UDDI Works
Software companies,
1. standards bodies, and
developers populate the
registry with descriptions Marketplaces, search
(specifications) of types of engines, and business
services 4. applications query the
registry to discover
services at other
2. companies and to
facilitate integration
UDDI Registry

Implementations Service Types


5.
Implementers
populate the
UDDI Registry assigns a
registry with 3. programmatically unique identifier to
descriptions
each service and registration
of their
businesses
and the Large businesses
services they apply the same
expose architecture and
technologies
internally
Public Registry Operation
Peer registry nodes (websites) Developers
Information registered
with any node Applications
Registrations replicated
Marketplaces
on a daily basis
Complete set of End Users
“registered” records IBM queries
available at all nodes
Common set of
SOAP APIs supported
by all nodes other
Compliance enforced UDDI.org
HP (planned)
by business contract
All technologies applied
Interoperability other Microsoft
verified constantly
What is WSDL?

Web Services Description Language


(WSDL)
•Provides a contract that defines a Web
interface
•XML based format
•Can define a schema for any XML
interface (not necessarily just SOAP)
•Defines endpoints
Adder Program

package test;
public class adder{

public long addit(int a , int b)


{
return a+b;
}
}
WSDL

<?xml version="1.0" encoding="UTF-8"?>


<definitions name="adder_Service"
targetNamespace="http://localhost:7001/adder-interface"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://localhost:7001/adder"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<message name="InadditRequest">
<part name="meth1_inType1” type="xsd:int"/>
<part name="meth1_inType2” type="xsd:int"/>
</message>
<message name="OutadditResponse">
<part name="meth1_outType” type="xsd:long"/>
</message>
WSDL

<portType name="adder_Service">
<operation name="addit">
<input message="InadditRequest"/>
<output message="OutadditResponse"/>
</operation>
</portType>
WSDL
<binding name="adder_ServiceBinding" type="adder_Service">
<soap:binding style="rpc”
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="addit">
<soap:operation soapAction="urn:adder-service"/>
<input>
<soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:adder-service” use="encoded"/>
</input>
<output>
<soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:adder-service" use="encoded"/>
</output>
WSDL
</operation>
</binding>
<service name="adder_Service">
<documentation>IBM WSTK 2.0 generated service definition file
</documentation>
<port binding="adder_ServiceBinding” name="adder_ServicePort” >
<soap:address location="http://localhost:7001/soap/servlet/rpcrouter"/>
</port>
</service>
</definitions>
Our Prototype
Customer Order Creation
Apache Soap Server v 2.2
Weblogic 5.1 sp 9 integrated with
Weblogic 5.1 sp 9

Order No.

HTML EJB
EJB
Servlet
Form
Order details SOAP

DB
Oracle

Application 1 Application 2
Tool s and Resourc es

•http://xml.apache.org/soap/
--> Apache SOAP Server

•http://www.alphaworks.ibm.com/tech
/webservicestoolkit
--> IBM Alphaworks WebServices Toolkit

You might also like