34
J.Amirtharaj Solomon jamirtha@covansys. com WEB SERVICES

Web Service Atg

Embed Size (px)

Citation preview

Page 1: Web Service Atg

J.Amirtharaj [email protected] Group

WEB SERVICES

Page 2: Web Service Atg

The Web Services fundamental ArchitectureCore technologies:

SOAPUDDIWSDL

Tools and Resources

WEB SERVICES

Page 3: Web Service Atg

What are Web Services?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 schedulesstock quotescredit checkcredit card validation

Page 4: Web Service Atg

Web Services

Eg.Transactional Web Services for

B2B or B2Cairline reservationsrental car agreementspurchase order

Page 5: Web Service Atg

Web Services

CharacteristicsIt 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.

Page 6: Web Service Atg

Web Services fundamental Architecture

Page 7: Web Service Atg

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).

Page 8: Web Service Atg

Foundation for Web Services

Ubiquitous Communications: InternetUbiquitous Communications: Internet

Universal Data Format:Universal Data Format: XMLXML

Service Interactions:Service Interactions: SOAPSOAP

Formal Service Descriptions:Formal Service Descriptions: WSDLWSDL

Broad Industry Support, Simple ProcessBroad Industry Support, Simple Process

Publish and Discover Services:Publish and Discover Services: UDDIUDDI

Page 9: Web Service Atg

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 method parameters, return values, and exceptions.

Page 10: Web Service Atg

SOAP

SOAP 1.0: Userland, Microsoft, DevelopMentor

SOAP 1.0 was specific to COM and HTTP

Page 11: Web Service Atg

SOAPSOAP 1.1 (April 23, 2000) - includescontributions from IBM and Lotussubstitutable Transport bindings (not just HTTP)substitutable Language bindings (e.g. Java)substitutable Data encodings (pluggable)completely vendor-neutralindependent of: programming language, object

model, operating system, or platform

Page 12: Web Service Atg

SOAPRequest and Response messagesRequest invokes a method on a remote

objectResponse returns result of running the

methodSOAP defines an "envelope""envelope" wraps the message itselfmessage is a different vocabularynamespace prefix is used

Page 13: Web Service Atg

SOAP - Headers

POST /foobar HTTP/1.1

Host: 209.110.197.12

Content-Type: text/plain

Content-Length: 12

•Request

•Response200 OK

Content-Type: text/plain

Content-Length: 12

Connection: close

Page 14: Web Service Atg

SOAP <?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" 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/encoding/">

<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 Envelope Namespacefor wrapping messages

Method Call

Page 15: Web Service Atg

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>

Page 16: Web Service Atg

SOAP hides the serviceimplementation from requester

Web Server

Soap Server

EJB CORBA COBOL

?????????????????Standard XML request/response

Page 17: Web Service Atg

SOAP and Security

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 ).

Page 18: Web Service Atg

What is UDDI?Universal Description, Discovery, and IntegrationA project to speed interoperability and adoption

for web servicesStandards-based specifications for service

description and discoveryShared operation of a web-based business

registryPartnership among industry and business leaders

more than 70 companies have signed up so far

Page 19: Web Service Atg

What Problems UDDI Solves?

A mid-sized manufacturer needs to create 400 online relationships with customers, each with their own set of standard and protocols

BroaderB2B

A flower shop in Australia wants to be “plugged in” to every marketplace in the world, but doesn’t know how

SmarterSearch

A B2B marketplace cannot get catalog data for relevant suppliers in its industry, along with connections to shippers, insurers, etc.

Easier Aggregation

Describe Services

Discover Services

IntegrateThemTogether

Page 20: Web Service Atg

UDDI v1 Implementation

UDDI RegistryProgrammatic descriptions of web

servicesProgramming model, schema, and

platform agnosticUses XML, HTTP, and SOAPFree on the Internet

Page 21: Web Service Atg

UDDI Registry EntriesStandards Bodies,

Agencies, Programmers, Publishers register specifications for their Service Types

Service providers register precise information about themselves and their Web services

Page 22: Web Service Atg

•Business name•General business description•Contact info

Names, phone numbers,

fax numbers, web sites, etc.

•Known identifiersList of unique identifiers for a business eg.D-U-N-S, Thomas, domain name, stock ticker symbol, other

Page 23: Web Service Atg

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

Page 24: Web Service Atg

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

Page 25: Web Service Atg

How UDDI Works

UDDI Registry

3. UDDI Registry assigns a programmatically unique identifier to each service and registration

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

44..

Service Types

11..

ImplementationsImplementers populate the registry withdescriptions of their businesses and the services they expose

22..

Large businesses apply the same architecture and technologies internally

55..

Software companies, standards bodies, and developers populate the registry with descriptions (specifications) of types of services

Page 26: Web Service Atg

Public Registry Operation

IBM

HP (planned)

Microsoftother

other

Peer registry nodes (websites)Information registered

with any nodeRegistrations replicated

on a daily basisComplete set of

“registered” recordsavailable at all nodes

Common set ofSOAP APIs supportedby all nodes

Compliance enforced by business contract

All technologies applied

Interoperability verified constantly

UDDI.org

queriesqueries

ApplicationsApplicationsApplicationsApplications

MarketplacesMarketplacesMarketplacesMarketplaces

End UsersEnd UsersEnd UsersEnd Users

DevelopersDevelopersDevelopersDevelopers

Page 27: Web Service Atg

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

Page 28: Web Service Atg

Adder Program

package test;public class adder{

public long addit(int a , int b){

return a+b;}

}

Page 29: Web Service Atg

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>

Page 30: Web Service Atg

WSDL

<portType name="adder_Service"> <operation name="addit"> <input message="InadditRequest"/> <output message="OutadditResponse"/> </operation></portType>

Page 31: Web Service Atg

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>

Page 32: Web Service Atg

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>

Page 33: Web Service Atg

EJBEJB

Our Prototype

HTMLForm

Servlet

DB Oracle

SOAP

Customer Order Creation

Weblogic 5.1 sp 9

Apache Soap Server v 2.2integrated with

Weblogic 5.1 sp 9

Application 1 Application 2

Order details

Order No.

Page 34: Web Service Atg

Tools and Resources

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

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