• No results found

Web Services Development In a Java Environment

N/A
N/A
Protected

Academic year: 2021

Share "Web Services Development In a Java Environment"

Copied!
10
0
0

Loading.... (view fulltext now)

Full text

(1)

April 16, 2008 1

Web Services Development

In a Java Environment

SWE 642, Spring 2008

Nick Duan

Overview

Services Process Architecture

XML-based info processing model Extending the Java EE Platform

Interface-driven development (vs. Model-driven)

Web Services Development using Apache Axis2

Axis2 features and tools

Development steps: from WSDL to application Axis WS examples

Universal Discovery, Description and Integration

UDDI concepts and Protocols jUDDI

Summary

(2)

4/16/2008 3

Services Process Architecture

Nick Duan

The implementation of WS today is not much different from the traditional distributed computing architecture (e.g. RMI, CORBA) Service Implementation Service Skeleton SOAP Transport Client Implementation Client Stub SOAP Transport

XML Data Binding XML Data Binding Parsing or XML Generation (Marshalling or Un-marshalling Parsing or XML Generation (Marshalling or Un-marshalling

Information Processing Model

April 16, 2008 Nick Duan 4

Applies to both client and server side

SAX or StAX <?XML Version=“1 .0”?>…. SOAP Doc Tokens Tokens Tokens Tokens Tokens Stream Parser XML data binding Data binding PaymentOrder Sender Name DueDate Addr Amount Application-specific Object Structure <?XML Version=“1 .0”?>…. Input Output XML data binding Message Generator

(3)

4/16/2008 Nick Duan 5

Interface-Driven Development

Model-drive development

Start from defining object models of the application servers Develop the client/server interfaces based on server application model

Works in a small environment with limited number of clients/consumers

Interface-driven development

Define the interfaces (in WSDL format) first without referring to a specific object model (only a conceptual, logical model) Standardize the interfaces

Should not change it often (why)

Change should be made through an configuration change process Use tools (such as WSDL2Java) to generate the initial development template for both client and server

Register the service (once developed) with standard service registry (e.g. UDDI registry)

4/16/2008 Nick Duan 6

Web Services Environment with

Infrastructure Services

Web Services discovery via UDDI Web Services invocation via SOAP calls

UDDI Service Registry Service Consumer Service Provider

Discover Service Publish Service

(4)

4/16/2008 Nick Duan 7

Apache Axis2

The most popular open source SOAP engine

available, based on standard Java EE servlet

container platform

Support common Web Services standards

SOAP 1.1 and 1.2 WSDL 1.1 and 2.0

WS-Addressing, WS-Policy

Support REST-style service invocation

Support POJO-style service implementation

Better performance and extensibility

4/16/2008 Nick Duan 8

Axis2 Components

Axis services are bundled in .aar files and

deployed within the service container

Servlet Container

Axis2 Service Container (war)

Service Instance (.aar)

Service.xml

WSDL files Service

implementation WSDL files Service

(5)

Se

rvic

e

Implem

en

tati

on

4/16/2008 Nick Duan 9

Axis2 SOAP Processing Model

Transport Listener Transport Sender Transport Listener Transport Sender SOAP SOAP

Clien

t Ap

plic

ation

Inbound msg handler Outbound msg handler M sg Sen de r M sg Receiver M sg Sen de r M sg Receiver Inbound msg handler Outbound msg handler

Axis2 Programming Model

April 16, 2008 Nick Duan 10

Five ways in Axis2 to create and deploy web

services applications

POJO (Plain Old Java Object) AXIOM (AXIs Object Model) Axis2 Data Binding (ADB)

XMLBeans (Apache Open Source project) JiBX (an API framework for XML-Java data binding, not a JCP standard)

Two types programming styles

From server code to WSDL

(6)

4/16/2008 Nick Duan 11

Two different programming styles

WSDL-driven development steps (applicable to ADB, XMLBeans and JiBX based service development)

Define WSDL first

Generate Service Skeleton using WSDL2Java tool Define service.xml file

Generate Axis archive file (.aar) and deploy the service to service container

Code-driven development steps (applicable to POJO and AXIOM based service development)

Create service implementation Generate WSDL using Java2WSDL tool Define service.xml file

Generate Axis archive file (.aar) and deploy the service to service container

Client development steps

Create client stubs using WSDL2Java tool Integrate stubs to client application

Make sure axis2.jar and supporting libs in the classpath

4/16/2008 Nick Duan 12

UDDI

Universal Discovery, Description and

Integration, an OASIS standard for registry of

web services.

Initially introduced by Microsoft, IBM and Ariba

in 2000 (version 1.0) for B2B services. The

current latest specification is UDDI v. 3

The spec defines the following entities

A data model defining the registry components A set of Web Services APIs for interacting with the registry as a web service, including inquiry and publishing, replication, security, and registry content management

(7)

UDDI Data Model

Four main data objects

businessEntity– Info about the publisher of services

businessService– Info about a family of services bindingTemplate– Info about service end point and implementation details (e.g. WSDL)

tModels (technical models) – Used to represent unique concepts or constructs for identifying and characterizing services (e.g. taxonomy/categories, security and operation requirements needed for accessing the services, etc.) and to enable interoperability across multiple services

April 16, 2008 Nick Duan 13

Representing businessEntity

All data structures are represented in

UDDI in XML Schema

(8)

Representing businessService

April 16, 2008 Nick Duan 15

4/16/2008 Nick Duan 16

UDDI Reference Implementations

Commercial Products

HP Systinet Registry product IBM WebSphere UDDI Registry

Microsoft UDDI Registry (Bundled with Windows 2003 server)

BEA WebLogic UDDI server (part of the WebLogic server)

Software AG CentraSite

Open Source

jUDDI (Apache Open Source)

Most vendors are integrating UDDI registry with vendor-specific repository products to provide design-time SOA governance functions

(9)

April 16, 2008 Nick Duan 17

Online References

Apache Axis2

http://ws.apache.org/axis2/

Apache AIOXM

http://ws.apache.org/commons/axiom/index.html

XMLBeans

http://xmlbeans.apache.org

UDDI standard specification

http://www.oasis-open.org/specs/index.php#uddiv3.0.2

Apache jUDDI

http://ws.apache.org/juddi

February 6, 2008 Nick Duan 18

Summary

Web Services development can take multiple

forms based on a wide-range of tools (e.g. Axis,

JAX-WS, etc.)

Interface-driven approach provides better

reusability and maintainability then the

model/code-driven approach in large scale Web

Services implementation

As a core infrastructure service, a UDDI registry

provides dynamic service discovery and is

essential part for enabling service interactions in

an enterprise

The concept of UDDI is the same as a yellow

page or a directory service on the internet

(10)

Quiz

Install Apache Axis2 and run the

user-guide samples in the sample directory

Modify the StockQuoteService WSDL

by adding a new operation called

getAllPrices which returns a list of

quotes with symbols (you may design

your own list structure), and implement

the service

References

Related documents

Our apartment in that are neighbors obligated to keep their quiet on our products are bothered by loud, just moved into turning the balcony.. Longer as much is obligated to keep

W/()8:*5(.8/GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG

Speci fi- cally, we aimed to evaluate whether the presence of high levels of sub- clinical positive or negative symptoms as measured by the Community Assessment of Psychic

UDDI/WSIL ADS naming service DISCO property service Directory WSDL Description SOAP basic Web Service Transport XML Content Web Infrastructure Service... What is a

The Section has achieved its goal efficiently by rendering its Secretarial assistance to the Department-related Parliamentary Standing Committee on Transport, Tourism and

Health risk behaviors are associated with demographic and job characteristics such as gender, age group, job, or work type (21,22]. Therefore, we need to consider the

The transitivity operator can be used to derive trust from a trust path consisting of a chain of trust edges, and the fusion operator can be used to combine trust from parallel

subsistence foreign aid has an explicit element of maintaining the status quo. 3) Military aid – the dominant form of foreign aid in the 1950s, and arguably a critical part of