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: Service Interactions: Universal Data Format: UDDI

Formal Service Descriptions: WSDL SOAP 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 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

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

<?xml version='1.0' encoding='UTF-8'?> <SOAP-ENV:Envelope xmlns:SOAPENV="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" SOAPENV: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

SOAP Envelope Namespace for wrapping messages

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 request/response EJB CORBA COBOL

SOA P and Se cu rit y
„ the standard authentication (e.g., SSL) mechanisms that are HTTPfriendly 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?

Broader B2B Smarter Search Easier Aggregation

A mid-sized manufacturer needs to create 400 online relationships with customers, each with their own set of standard and protocols A flower shop in Australia wants to be “plugged in” to every marketplace in the world, but doesn’t know how A B2B marketplace cannot get catalog data for relevant suppliers in its industry, along with connections to shippers, insurers, etc.

Describe Services Discover Services Integrate Them Together

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 providers register precise information about themselves and their Web services

 Service

•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.DU-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
1.
Software companies, standards bodies, and developers populate the registry with descriptions (specifications) of types of services

4.

2. UDDI Registry

Marketplaces, search engines, and business applications query the registry to discover services at other companies and to facilitate integration

Implementers populate the registry with descriptions of their businesses and the services they expose

Implementations

Service Types

5.

3.

UDDI Registry assigns a programmatically unique identifier to each service and registration Large businesses apply the same architecture and technologies internally

Public Registry Operation
Peer registry nodes (websites) Information registered with any node Registrations replicated on a daily basis Complete set of “registered” records available at all nodes Common set of SOAP APIs supported by all nodes Compliance enforced by business contract All technologies applied
Interoperability verified constantly Developers Applications Marketplaces IBM queries End Users

other

UDDI.org

HP (planned)

other

Microsoft

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
Weblogic 5.1 sp 9 Apache Soap Server v 2.2 integrated with Weblogic 5.1 sp 9

Order No. HTML Form Servlet Order details SOAP DB Oracle Application 1 Application 2

EJB EJB

Tool s and Resourc es
•http://xml.apache.org/soap/ --> Apache SOAP Server •http://www.alphaworks.ibm.com/tech /webservicestoolkit --> IBM Alphaworks WebServices Toolkit

Sign up to vote on this title
UsefulNot useful