Web Services Development in Websphere V5: by Tapas Banerjee Ceo, Web Age Solutions Inc
Web Services Development in Websphere V5: by Tapas Banerjee Ceo, Web Age Solutions Inc
by
Tapas Banerjee
UDDI Registry
1. Publish 3. Discover
Message-based:
Document-driven.
Asynchronous model.
Web Services
Programming APIs
APIs for RPC-based Web Services:
Sun’s JAX-RPC (Java API for XML-RPC) in WSDP.
Apache’s SOAP-RPC (Apache SOAP 2.3 ships with WAS5)
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Different SOAP Implementations
SOAP4J - A Java reference implementation of the
SOAP 1.1 specification. It now became the basis of
the Apache SOAP 3.x project, also called Axis.
Apache SOAP 2.3
– Ships with WebSphere V5
– Important elements are
●
Rpcrouter and messagerouter servlets
●
The deployment descriptor
●
Type mapping registry
What is WSDL?
WSDL is an XML-based language for defining
available Web Services and describing how to
access the services, including URL endpoint,
message format, encoding and required protocol.
Similar to IDL (Interface Definition Language) for
CORBA, describing the services and how to use
the services
WSDL 1.1 is the current standard.
Tools available to generate WSDL files.
UDDI Data Structure
Five data
structure types: <businessEntity>
<publisherAssertion>
Name
<businessEntity> description
name, contact, identification
– businessEntity name, contact,category
description, identification
description, category
– businessService
<businessService>
– bindingTemplat (1..n)
<businessService>
e name
(1..n)
description
name
– publisherAsserti description reference
on <bindingTemplate>
<bindingTemplate> <tModel>
– tModel Name
Description
URL pointer
to specification
UDDI4J
IBM’s UDDI4J is a Java-based UDDI client
API.
It provides package/classes for accessing
UDDI registry (publishing and discovering).
UDDIProxy object is the client side proxy
of the registry.
Program the UDDIProxy for
publishing/discovering services.
Developing Web Services
Generate deployable web service from
– Java Bean
– DADX (XML/DB2 mapping documents)
– Enterprise Java Bean
– URL
Generate skeleton Java Bean and sample
application from WSDL document
Web Services Client wizard also creates
– Web Service Proxy as Java Bean
– Sample JSP-based client application
Overall Workflow
Typical development path
1. Create a Web Project
2. Create/Import a resource from which to create a
web service (Java Bean, EJB, DADX document,
…)
3. Create a Web Service using Web Service Wizard
4. Publish a Business Entity, if required
5. Publish the Web Service
Creating a Web Service from a Java
Bean
Typical steps:
1. Create/Import Java Bean into Web Project
2. Generate binding WSDL document using Web
Service Wizard
3. Deploy Web Service to a Web Server
4. Generate client proxy
5. Generate sample client application
Then publish, discover and use web service
… from an EJB
Typical steps:
1. Create a Web Project
2. Create/Import EJBs into an EJB Project belonging to the
same Enterprise Application Project as the Web Project
3. Update project dependencies
… then it’s “business as usual”
WSAD only generates a Web Service from a
Stateless Session EJB
– … but that session bean can always use entity beans!
Web Service Development Phases
Build
– May start from Java code, then we generate WSDL
from that
– Or start from WSDL and build/morph Java code to
match
Deployment
– We can publish using
●
UDDI, WSIL or E-mailing customers
Run
Management
Different web service creation
paths
From an existing application – bottom-up
– Most common. We like to expose existing back-end systems
for enterprise integration (EAI) purposes.
From WSDL, generate a completely new application –
top-down
– This may be due to a new spec imposed by a governing body
– The wizards can create skeleton code from WSDL, we then fill
up the details
Combine independent web services to provide new
functionality. This route is similar to the façade design
pattern.
Different WebSphere products –
how do they fare?
There are three products in the WebSphere family that
can be used
– WSAD
– WSAD IE
– WebSphere SDK for web services (WSDK) family
All three can do bottom-up and top-down from
JavaBeans
WSAD IE and WSDK can do bottom-up and top-down
from EJB’s
– Regular WSAD cannot do top-down for EJB’s I.e. cannot create
EJB’s from WSDL.
… from XML schema
Generate Java Bean from XML schema
1. Create any project that works with Java source
code (Java, EJB, Web, …)
2. Create/Import XML schema in the project
3. Start Web Services Wizard
4. Select Java beans for XML Schema.
5. Follow instructions to generate Java Beans
Now generate the Web Service from the new
Java Bean
WSDK 5.0
WebSphere SDK for Web Services
– Entry level developer kit, free for development
– But not for production or deployment
– Runs on Windows 2000/XP and Linux
– Based on Axis (Apache SOAP engine)
– Has embedded application server (mini WebSphere
5.0) and a private UDDI registry
– Supports SOAP 1.1, WSDL 1.1, UDDI 2.0, JAX_RPC
1.0, WSDL4J, UDDI4J and WS-Security
ETTK (previously called WSTK)
IBM Emerging Technologies Toolkit (previously called Web
Services toolkit)
An IBM alphaworks technology, showcases technologies to
come
Exposes the AXIS programming model
WSTK version 3.2.2 includes
– WS-C/WS-Tx for transaction flows between components
– Web Services matchmaking engine – Businesses submit
advertisements. When a customers search matches an
advertisement, a response is triggered
– WSXL – For better handshaking of web services with portal
applications
Web Services Deployment in
WebSphere
If you are using WSAD 5, it is same as
deploying an EAR file
If you are using WSAD 4
– Export the Web Service as a WAR
– Use AAT to create an EAR
– Use soapearenabler.bat to add SOAP services
Summary
We discussed
– What are Web Services.
– Web Services programming model.
– How does a SOAP message look.
– Developing Web Services.
– Web Service Development Phases.