Web Services Development Concepts (WSDC 1.0)
Web Services Development Concepts (WSDC 1.0)
Web Services Development Concepts (WSDC 1.0)
Web Services
Development Concepts
(WSDC 1.0)
May 2001
By Peter Brittenham
IBM Software Group
IBM Software Group Front Matter
Notices
The authors have utilized their professional expertise in preparing this report. However, neither
International Business Machines Corporation nor the authors make any representation or
warranties with respect to the contents of this report. Rather, this report is provided on an AS IS
basis, without warranty, express or implied, INCLUDING A FULL DISCLAIMER OF THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Contents
Notices ..............................................................................................................................................ii
Contents...........................................................................................................................................iii
Figures ............................................................................................................................................. v
Tables .............................................................................................................................................. v
Preface.............................................................................................................................................vi
Abstract .......................................................................................................................................vi
Target Audience ..........................................................................................................................vi
Comments ...................................................................................................................................vi
Overview .......................................................................................................................................... 7
Web Services Development Lifecycle ............................................................................................. 7
Build............................................................................................................................................. 7
Deploy ......................................................................................................................................... 8
Run............................................................................................................................................... 8
Manage........................................................................................................................................ 8
Developing Web Services ............................................................................................................... 9
Service Registry........................................................................................................................... 9
Service Provider .......................................................................................................................... 9
Green Field.............................................................................................................................. 9
Build .................................................................................................................................. 10
Deploy............................................................................................................................... 10
Run.................................................................................................................................... 11
Top-Down .............................................................................................................................. 11
Build .................................................................................................................................. 12
Deploy............................................................................................................................... 12
Run.................................................................................................................................... 13
Bottom-Up ............................................................................................................................. 13
Build .................................................................................................................................. 14
Deploy............................................................................................................................... 14
Run.................................................................................................................................... 14
Meet-in-the-Middle ................................................................................................................ 14
Build .................................................................................................................................. 15
Deploy............................................................................................................................... 15
Run.................................................................................................................................... 16
Service Requestor ..................................................................................................................... 16
Static Binding ........................................................................................................................ 16
Build .................................................................................................................................. 17
Deploy............................................................................................................................... 17
Run.................................................................................................................................... 17
Build-Time Dynamic Binding................................................................................................. 18
Build .................................................................................................................................. 18
Deploy............................................................................................................................... 19
Run.................................................................................................................................... 19
Runtime Dynamic Binding..................................................................................................... 19
Build .................................................................................................................................. 20
Deploy............................................................................................................................... 20
Run.................................................................................................................................... 20
Web Service Tools ......................................................................................................................... 21
UDDI Browser............................................................................................................................ 21
UDDI Editor................................................................................................................................ 21
UDDI Publishing Tools............................................................................................................... 21
WSDL Editor .............................................................................................................................. 21
WSDL Generator........................................................................................................................ 21
Service Proxy Generator ........................................................................................................... 22
Service Implementation Template Generator ........................................................................... 22
Developing Web Services Using Java .......................................................................................... 23
Service Provider ........................................................................................................................ 23
Green Field............................................................................................................................ 24
Build .................................................................................................................................. 24
Deploy............................................................................................................................... 25
Run.................................................................................................................................... 26
Top-Down .............................................................................................................................. 26
Build .................................................................................................................................. 26
Deploy............................................................................................................................... 26
Run.................................................................................................................................... 27
Bottom-Up ............................................................................................................................. 27
Build .................................................................................................................................. 27
Deploy............................................................................................................................... 27
Run.................................................................................................................................... 27
Meet-In-The-Middle............................................................................................................... 28
Build .................................................................................................................................. 28
Deploy............................................................................................................................... 28
Run.................................................................................................................................... 28
Service Requestor ..................................................................................................................... 28
Static Binding ........................................................................................................................ 29
Build .................................................................................................................................. 29
Deploy............................................................................................................................... 29
Run.................................................................................................................................... 29
Build-Time Dynamic Binding................................................................................................. 30
Build .................................................................................................................................. 30
Deploy............................................................................................................................... 30
Run.................................................................................................................................... 30
Runtime Dynamic Binding..................................................................................................... 30
Build .................................................................................................................................. 30
Deploy............................................................................................................................... 31
Run.................................................................................................................................... 31
Related Information........................................................................................................................ 32
Web Sites................................................................................................................................... 32
Other Papers ............................................................................................................................. 32
Figures
Figure 1. Green field method......................................................................................................... 10
Figure 2.Top-down method ........................................................................................................... 12
Figure 3. Bottom-up method.......................................................................................................... 13
Figure 4. Meet-in-the-middle method ............................................................................................ 15
Figure 5. Static binding.................................................................................................................. 17
Figure 6. Build-time dynamic binding............................................................................................ 18
Figure 7. Dynamic runtime binding ............................................................................................... 20
Tables
Table 1 .Service provider methods.................................................................................................. 9
Table 2. Green field method ............................................................................................................ 9
Table 3. Top-down method............................................................................................................ 11
Table 4. Bottom-up method ........................................................................................................... 13
Table 5. Meet-in-the-middle method ............................................................................................. 14
Table 6. Service requestor methods.............................................................................................. 16
Preface
Abstract
This paper describes the approach for developing Web Services from the point of view of the
developer of service providers and service requestors. The development approach explains the
components, interactions, application development patterns and tools necessary to implement
Web Services in general. It relates these common concepts to their application using Java
technology.
The development approach presented in this paper includes high-level descriptions of the
components and functions required for Web Services, and requirements on the tools and
middleware to implement these components and functions. Some of this functionality exists
today in products such as the IBM XML and Web Services Development Environment, the IBM
Web Services Toolkit, and IBM WebSphere Application Server. These and other products will
implement additional functions in the future. However, the presence of a component, function or
requirement in this paper does not guarantee that it will be implemented in future IBM products.
Target Audience
• Early adopters and implementers of Web Services
• External technical reviewers seriously evaluating the IBM Web Services approach.
Reviewers should read the Web Services Overview and Value paper that explains the
value of Web Services, and the Web Services Conceptual Architecture paper that
explains the IBM approach to Web Services technologies.
Comments
Please send any feedback, technical or editorial, to Web Services at wbservcs@us.ibm.com or
webservices/Raleigh/IBM@IBMUS.
Overview
When developing Web Services, there are build, deployment and runtime considerations for
Web service developers and Web service requestors. This paper outlines the architectural
components, subsystems and best practices for the creation, packaging and usage of a Web
service.
The service requestor, service provider and service registry roles are incorporated in the
development approach at varying levels depending on business needs and the robustness
required to facilitate the publish, find and bind operations.
Each component role has specific requirements for each phase of the development lifecycle.
This paper describes the interactions between the Web Services component roles of service
provider and service requestor. (The development and deployment of a service registry is
outside the scope of this paper.) This paper describes the primary tasks defined by the
development lifecycle. The service provider and service requestor roles are logical constructs,
because a single service can exhibit characteristics of both a service requestor and service
provider.
An example of a complete end-to-end lifecycle scenario would start with the creation and
publication of a service interface (build), proceed to the creation and deployment of the Web
service (deploy), move on to the publication of the service implementation definition and end
with the invocation of the Web service by the service requestor (run).
The development lifecycle encompasses the following phases: build, deploy, run, and manage.
Build
The build phase of the lifecycle includes development and testing of the Web Services
implementation, the definition of the service interface description and the definition of the service
implementation description. Locating an existing service interface definition is also a build-time
function. The Web Services implementations can be provided by creating new Web Services,
transforming existing applications into Web Services, and composing new Web Services from
other Web Services and applications. This paper focuses on the development concepts for a
single Web service.
Developing a new Web service involves using the programming languages and models that are
appropriate for the service provider’s environment. Transforming existing applications into Web
Services involves generating service interfaces and service wrappers to expose the
application’s relevant business functions. Composing new Web Services from existing Web
Services involves sequencing and orchestrating message flows between programs directly or
with workflow technologies. The Web Services that are used to compose a workflow can exist
within the enterprise and outside the enterprise.
There are some similarities between a Web service development approach and object-oriented
programming, because it uses constructs such as encapsulation, interface inheritance using
tModels, and dynamic binding. This means that object-oriented design methodologies can be
applied to Web Services design, but it is not required to design a Web service.
Deploy
The tasks associated with the deploy phase of the development lifecycle include the publication
of the service interface and service implementation definition, deployment of the runtime code
for the Web service and integration with back-end legacy systems.
For Web Services representing transformed applications, deployment can include only the Web
service wrapper because the application might already be deployed. For service flows,
deployment will include customization of the workflow manager and business process manager
to execute and monitor the new flows. Additional administrative integration into the execution
environment would also have to be performed for the definition of operation-based authorization
and service credentials and integration with back-end legacy applications.
Run
During the run lifecycle phase, the Web service is fully deployed and operational. During this
stage of the lifecycle, a service requestor can find the service definition and invoke all defined
service operations. The runtime functions include static and dynamic binding, service
interactions as a function of Simple Object Access Protocol (SOAP) messaging and interactions
with legacy systems.
Manage
The manage phase of the Web service lifecycle covers ongoing management and administration
of the Web service application. Security, availability, performance, quality of service and
business processes must all be addressed. Because this paper focuses on the development of
Web Services, this phase of the lifecycle is not covered.
Service Registry
The service registry provides a role in the Web Services development approach, but it is a
passive participant. It is assumed that the registry has been built and deployed before it is
selected for use by the service provider or service requestor. For this reason, the development
lifecycle for the service registry is not provided in this paper.
Service Provider
There are four basic methods that a service provider can use to develop a Web service. The
method that is used is based on the existence of the service interface and application that will
become the Web service. Table 1 provides an overview of these development methods.
Service
Registry
Service
Interface
Publish
Service
Implementation
Find
Develop
Service
Proxy
Service
Service Bind
Service
Requestor Provider
Build
Deploy
Run
Top-Down
Service Interface Exists
Web Service New
Table 3. Top-down method
As shown in Table 3, using this method, a new Web service can be developed that conforms to
an existing service interface. This type of service interface is usually part of an industry
standard, which can be implemented by any number of service providers. As Figure 2 shows,
the service provider must find the service interface, implement the interface contained in this
definition, and then deploy the new Web service. The service interface can not be owned by the
service provider.
Service
Registry
Find
Service
Interface
Service
Implementation
Publish
Find
Generate
Skeleton
Service Develop
Proxy Service
Interface
Service
Service Bind
Service
Requestor Provider
Build
Deploy
The deployment steps for the top-down method are the same as deployment steps 2 to 4 for the
green field method. For the deploy phase, the only difference is that the service interface has
already been published by another entity.
1. Deploy the Web service.
Deploy the runtime code for the service, and any deployment meta-data that is required
to run the service.
Run
Bottom-Up
Service Interface New
Web Service Exists
Table 4. Bottom-up method
As shown in Table 4, the bottom-up method is used to create a new service interface for an
existing application. The application can be implemented as an Enterprise JavaBean (EJB),
JavaBean, servlet, C++ or Java class file, or Component Object Model (COM) class. The service
interface is derived from the application's application programming interface (API). Figure 3
shows the generation of the application.
Service
Registry
Service
Interface
Publish
Service
Implementation
Find
Service
Generate Interface
Service
Proxy Service
Service Bind
Service
Requestor Provider
Build
Deploy
Run
Meet-in-the-Middle
Service Interface Exists
Web Service Exists
Table 5. Meet-in-the-middle method
As shown in Table 5, the meet-in-the-middle method for developing a Web service is used when
a service interface already exists and the application that will be used for the Web service
already exists.
The primary task for this method of developing a Web service is to map the existing application
interfaces to those defined in the service interface definition. As shown in Figure 4, this can be
done by creating a wrapper for the application that uses the service interface definition, and
contains an implementation that maps the service interface into the existing application
interface.
Service
Registry
Find
Service
Interface
Service
Implementation
Publish
Find
Generate
Skeleton Service
Interface
Service Develop
Proxy
Service Service
Bind Wrapper
Service
Service
Requestor
Provider
Build
The first two build steps are the same as those for the top-down method.
Deploy
The deployment steps for the meet-in-the-middle method are the similar to those for the bottom-
up method. The only difference is that the service interface is already published.
Run
Service Requestor
The service requestor progresses through the same lifecycle elements as the service provider,
but the requestor performs different tasks during each phase. The build time tasks for the
service requestor are dictated based on the method for binding to a Web service.
The service interface is used to generate a service proxy. The service proxy contains all of the
code that is required to access and invoke a Web service. As an example, if the Web service is
a SOAP service, the service proxy will contain all of the SOAP client code that is required to
invoke a method on the SOAP service.
There are three methods for binding to a specific service. A static binding is used only at build
time, whereas dynamic binding can be used either at build time or runtime. A static binding can
not be used at runtime, because it requires all of the information needed to bind to a service at
build time.
Static Binding
A service requestor will use a static binding (Figure 5) when there is only one service
implementation that will be used at runtime. The static binding is built at build time by locating
the service implementation definition for the single Web service that will be used by the service
requestor. The service implementation definition contains a reference to the service interface,
which will be used to generate the service proxy code. The service proxy contains a complete
implementation of the client application that can be used by the service requestor to invoke Web
service operations.
Service
Registry
Service
Interface
Service
Implementation
Find
Publish
Service Generate
Implementation
Service
Proxy Service
Service Bind
Service
Requestor Provider
Build
Deploy
Run
Service
Registry
Find
Service
Interface
Service
Implementation
Find
Publish
Service Generate
Interface
Service
Proxy Service
Service Bind
Service
Requestor Provider
Build
Deploy
Run
Service
Registry
Find
Service
Interface
Service
Implementation
Find
Publish
Service Generate
Interface
Service
Proxy Service
Service Bind
Service
Requestor Provider
Build
Deploy
Run
UDDI Browser
This browser allows the developer to interactively browse the Universal Description, Discovery
and Integration (UDDI) registry to find the services that can already be defined. This allows the
developer to download an interface definition that would be the basis for the development of a
conforming service.
UDDI Editor
The UDDI editor is used by the service developer to create different UDDI entries, including the
businessEntity, businessService and tModel information needed to publish the service in a UDDI
registry.
WSDL Editor
This creates WSDL interfaces for publication. It is used by developers who are creating WSDL
documents to describe Web Services from scratch.
WSDL Generator
The WSDL generator produces WSDL interface documents that describe interfaces
implemented by existing applications. This tool can be used to automatically generate a WSDL
document describing EJBs, JavaBeans, servlets, C++ or Java class files, Common Object
Request Broker Architecture (CORBA), Interface Definition Language (IDL), COM class, and
MQSeries message definitions that have already been implemented. This tool also generates
WSDL implementation documents, including support for non-IBM environments such as
Microsoft .NET.
For SOAP services, the WSDL generator should also create the SOAP deployment descriptor
which is required to deploy the service.
Homogeneity across the service requestor and service provider component is not a requirement
with respect to programming language or component model. Because this is a derivation of the
Web Services development approach, the loosely coupled characteristics of Web Services are
maintained such that a requestor can employ a non-Java-based Web Services development
approach while maintaining interoperability with a peer Web service being hosted by a Java-
based service provider.
Service Provider
Within this development approach, the service provider hosts Web Services within a Java
runtime environment. The Java runtime environment consists of the following components:
If RPC-based, the provider will convert the service result to a SOAP envelope. This
conversion is typically defined by an object model. For example, Apache SOAP 2.1
provides an org.apache.SOAP.RPC.SOAPContext object to encapsulate the
envelope.
The following are examples of pluggable providers that are used to interact with Java
objects:
• EJB container
Hosting environment that manages EJB lifecycles. Required for EJB-based Web service
implementations.
A Web service deployed in this environment will be implemented using one or more of the
following methods:
1. Java class
2. Servlet
3. Bean Scripting Framework (BSF) compatible script
4. JavaBean
5. EJB
6. Java Native Interface (JNI) interface defined for native application components
Each of the following sections describes a method for developing a Web service using Java.
When describing the steps within each phase of the lifecycle, some methods use the same
steps. The repeated steps are described in detail only when they are listed for the first time.
Green Field
Build
The service interface is a WSDL document defining the type, messages and port type
elements. After the development of the Web service, a service interface definition should
be created. The service interface will describe the abstract operations supported by the
service and the messages that will be communicated.
For RPC interactions the messages represent input, input/output, and output
parameters. This process can be manual or automated via WSDL utilities. Given a fully
qualified class name for a Java class, bean, or servlet, a WSDL generation utility can
use reflection to generate the service interface. The desired methods are selected prior
to the generation of the service interface. Given an EJB deployment descriptor (that is,
jar file), a WSDL generation utility can create the service interface that exposes the
desired remote and home interface methods as service operations. IBM provides utilities
which will generate the appropriate WSDL interface document for the given
implementation types.
Deploy
Deploying the Web service implies integration of the Web service and relevant meta-
data with the Java runtime. The following characterizes the general deployment steps:
EJB service implementations will require the use of the EJB deployment descriptor
to generate the SOAP deployment descriptor. Methods of the remote and home
interfaces will be exposed as service operations. The SOAP deployment descriptor
for EJBs must reference an EJB provider. The Apache SOAP implementation
provides three EJB-compliant providers: stateless, stateful, and entity providers.
EJB implementations of Web Services will require the use of an EJB provider class,
which will unmarshall incoming SOAP request and forward the message to the
appropriate EJB as an EJB client. The response data is then marshalled and
returned to the SOAP client. The EJB is deployed within an EJB container.
The service implementation is a WSDL document defining the binding, service and port
elements. The service implementation will import a service interface document.
Generating the service implementation definition can be either a manual or automated
process. This information will provide location information for the service and reference
the service implementation definition. The SOAP address should reference the URL of
the appropriate SOAP router. The binding should reference the object ID provided in the
SOAP deployment descriptor as the namespace for the operations. The binding is typed
such that it is mapped to a particular port type defined by the service interface. IBM is
planning to provide tools that will simplify the generation of service implementations.
Run
The Web service can have multiple runtimes or simply run within the context of a Web
application server. For example, EJB service implementations will require the SOAP
server to execute in a Web application service, while the EJB implementation itself can
run in a separate runtime environment consisting of an EJB container.
Top-Down
Build
Run
The Web service can have multiple runtimes or simply run within the context of a Web
application server. For example, EJB service implementations will require the SOAP server
to execute in a Web application service, while the EJB implementation itself can run in a
separate runtime environment consisting of an EJB container.
Bottom-Up
Build
The service interface is a WSDL document defining the type, messages and port type
elements. After the development of the Web service, a service interface definition should
be created. The service interface describes the abstract operations supported by the
service and the messages that will be communicated. For RPC interactions, the
messages represent input, input/output, and output parameters. This process can be
manual or automated using WSDL utilities.
Given a fully qualified class name for a Java class, bean or servlet, a WSDL generation
utility can use reflection to generate the service interface. The desired methods are
selected prior to the generation of the service interface.
Given an EJB deployment descriptor (that is, jar file) a WSDL generation utility can
create the service interface that exposes the desired remote and home interface
methods as service operations. IBM provides utilities that will generate the appropriate
WSDL interface document for the given implementation types.
Deploy
Deploying the Web service implies integration of the Web service and relevant meta-
data with the Java runtime.
The service implementation is a WSDL document defining the binding, service and port
elements.
Run
The Web service can have multiple runtimes or simply run within the context of a Web
application server. For example, EJB service implementations will require the SOAP server
to execute in a Web application service, while the EJB implementation itself can run in a
separate runtime environment consisting of an EJB container.
Meet-In-The-Middle
Build
Deploy
Deploying the Web service implies integration of the Web service and relevant meta-
data with the Java runtime.
The service implementation definition is a WSDL document defining the binding, service
and port elements.
Run
The Web service can in fact multiple runtimes or simply run within the context of a Web
application server. For example EJB service implementations will require the SOAP server to
execute in a Web application service, while the EJB implementation itself can run in a
separate runtime environment consisting of an EJB container.
Service Requestor
Within this development approach, the service requestor is hosted within a Java runtime
environment. The Java runtime environment for the service requestor assumes only a Java
virtual machine. Because WSDL defines bindings for SOAP, HTTP GET/POST and MIME
extensions, the service requestor can access services from a browser or application runtime. A
Web service requestor deployed in this environment represents one or more of the following:
1. Java class
2. Servlet
3. JavaServer Pages (JSP)
4. JavaBean
5. EJB
6. JNI interface defined for native application components
7. Java Applet
Static Binding
Build
Develop the requestor application such that it uses the service proxy methods to invoke
the Web service.
Before deploying the service proxy it should be tested to verify that it can interact with
the specified Web service.
Deploy
Deploy the service proxy within a Java Virtual Machine (JVM) along with the requestor
Java application. A SOAP client is required to process the SOAP messages.
Run
Develop the requestor application such that it uses the service proxy methods to invoke
the Web service.
Before deploying the service proxy it should be tested to verify that it can interact with
the specified Web service.
Deploy
Deploy the service proxy within a JVM along with the requestor Java application.
Run
Now that the network address of the desired service implementation has been resolved,
the service can be invoked.
Deploy
Run
Now that the network address of the desired service implementation has been resolved
and the service proxy can be programmatically accessed, the requestor can invoke the
service.
Related Information
Web Sites
AXIS http://xml.apache.org/axis
DISCO http://msdn.microsoft.com/xml/general/disco.asp
EbXML http://www.ebxml.org/
JAVA http://java.sun.com/
OAG http://www.openapplications.org/
SOAP http://www.w3.org/TR/SOAP/
UDDI http://www.uddi.org/
WSDL http://www.uddi.org/submissions.html
XMLP http://www.w3.org/2000/xp/
XML Schema Part 1 http://www.w3.org/TR/xmlschema-1/
XML Schema Part 2 http://www.w3.org/TR/xmlschema-2/
Other Papers
Web Services Flow Language (WSFL 1.0)
05-01
All Rights Reserved