JBoss Web Services - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

JBoss Web Services

Description:

The purpose of this presentation is to summaries some of the issues involved in ... Need to copy a jar with web services implementation to: ... – PowerPoint PPT presentation

Number of Views:179
Avg rating:3.0/5.0
Slides: 16
Provided by: adaptL
Category:
Tags: ajar | jboss | services | web

less

Transcript and Presenter's Notes

Title: JBoss Web Services


1
JBoss Web Services
  • Stuart Wheater
  • Arjuna Technologies

2
Contents
  • The purpose of this presentation is to summaries
    some of the issues involved in using web services
    on JBoss
  • Cover
  • Overview of JBoss web services support
  • Publishing web services
  • Consuming web services
  • Overview of JBossNetExample

3
JBoss Web Service Support
  • JBoss.net
  • JBoss.net is a plug-in to the JBoss application
    server that support Web Services
  • Goals
  • Painless implementation and publication of
    J2EE-based Web Services
  • EJB and JMX
  • Seamless integration of external Web Services
    running on other business platforms into the J2EE
    environment

4
JBoss.net Team
  • Lead Developer Dr. Christoph Jung (Germany)
  • Web pages http//www.jboss.org/developers/project
    s/jboss/dotnet.jsp
  • The JBoss.net team is integrating Apache Axis
    into JBoss
  • JBoss 3.0.6 (26th January 2003)
  • Axis-1.0-beta1 (15th March 2002)
  • JBoss 3.2.0-RC1 (14th January 2003)
  • Axis-1.0 (7th October 2002)
  • JBoss.net is only available when using the all
    server environment
  • Start JBoss with the command run.sh -c all or
    run.bat -c all

5
Apache Axis
  • Axis is a SOAP engine, implemented in Java
  • A framework for constructing SOAP processors such
    as clients, servers, gateways
  • Began life as IBMs SOAP4J
  • Third generation of Apache SOAP engine
  • License The Apache Software License, Version 1.1
  • Latest version is Axis-1.1-RC1
  • 9th February 2003
  • http//ws.apache.org/axis/dist/1_1RC1/
  • Axis-1.1 release planned for late February

6
Publishing Web Services
  • Implementation techniques
  • JAX-RPC
  • Does not support JAXM
  • Axiss proprietary support
  • jws files
  • Deployment techniques
  • AdminClient
  • WSR file
  • Auto deploy source (jws files)

7
JAX-RPC High-level Service Interface
  • Standards compliant Java object level interface
  • Java API for XML-based RPC (JAX-RPC) 1.0
  • Java package javax.xml.rpc
  • Implement a web service
  • Service Endpoint interface
  • Java interface which defines method and
    parameters of web service
  • Can be created using the WSDL2Java tool
  • Provide an implementation of the Service
    Endpoint interface
  • Axis provider type javaRPC
  • Other features
  • Standards compliant API for Lifecycle event
    notification init() and destroy()
  • Standards compliant API for request and response
    interception

8
Axiss Low-level Service Interface
  • Axis provides a proprietary XML oriented
    interface
  • SOAP engine uses Java reflection to analysis
    deployed class for suitable method to call.
  • Axis-1.0-beta1 (JBoss-3.0.6)
  • org.w3c.dom.Element method(java.util.Vector)
  • org.w3c.dom.Element method(org.apache.axis.Messa
    geContext, java.util.Vector)
  • org.w3c.dom.Document method(org.w3c.dom.Document)
  • org.w3c.dom.Document method(org.apache.axis.Messag
    eContext, org.w3c.dom.Document)
  • org.w3c.dom.Document method(org.apache.axis.Messag
    eContext)
  • Axis-1.0 (JBoss-3.2.0-RC1)
  • org.apache.axis.message.SOAPBodyElement
    method(org.apache.axis.message.SOAPBodyElement)
  • org.w3c.dom.Element method(org.w3c.dom.Element
    )
  • org.w3c.dom.Document method(org.w3c.dom.Document)
  • void method(org.apache.axis.message.SOAPEnvelope,
    org.apache.axis.message.SOAPEnvelope)
  • Axis provider type javaMSG

9
Axiss Ultra-low-level Service Interface
  • Axis provides a raw engine interface
  • Register own provider class
  • Extension of the org.apache.axis.providers.BasicPr
    ovider class
  • void invoke(org.apache.axis.MessageContext)
  • void generateWSDL(org.apache.axis.MessageContext)
  • . . .
  • In deployment descriptor
  • ltservice providejavaorg.eu.adapt.AdaptablePro
    vidergt

10
jws File Very-Easy Service Interface
  • jws file provide a very simple technique to
    implementing and deploying web service
  • jws files contain Java source, but with a jws
    postfix.
  • Calculator.jws
  • public class Calculator public int add(int v1,
    int v2) return v1 v2
  • Deployed by simply copying jws file to
  • ltjboss homegt/server/all/deploy/jboss-net.sar/jboss
    -net.war
  • Engine will compile java and export methods as
    web service
  • Very useful for test web services
  • This does not seem to work with JBoss-3.2.0-RC1

11
Deployment descriptor (WSDD file)
  • Deployment in Axis is based on XML descriptions
    in WSDD files
  • Example
  • ltdeployment xmlns"http//xml.apache.org/axis/wsdd
    /" xmlnsjava"http//xml.apache.org/axis
    /wsdd/providers/java"gt ltservice
    name"JAXRPCCountersService" provider"javaRPC"gt
    ltparameter name"className
    value"org.eu.adapt.wsexample.ws.JAXRPCCountersImp
    l"/gt ltparameter name"allowedMethods"
    value"create remove set get increase"/gt ltparame
    ter name"scope" value"Application"/gt lt/servicegt
    lt/deploymentgt
  • Request, response and fault interceptors
  • ltrequestFlowgt lthandler . . ./gtlt/requestFlowgt

12
Deployment using AdminClient
  • Axis provides an administration program which
    allows web services to be registered and
    administer remotely
  • org.apache.axis.client.AdminClient
  • To publish a web service
  • Need to copy a jar with web services
    implementation to
  • ltjboss homegt/server/all/deploy/jboss-net.sar
  • Then run AdminClient with web services WSDD file
    as an argument

13
wsr File
  • JBoss.net have provided a more convenient
    technique for deploying web service, using wsr
    files
  • wsr files are a form of jar file
  • Contains the Java classes which implement the web
    service
  • Deployment descriptor is place in the file
  • META-INF/web-service.xml
  • The wsr file can be included in ear files.
  • ltmodulegtltjavagtwsexample.wsrlt/javagtlt/modulegt

14
Consuming Web Services
  • Implementation techniques
  • JAX-RPC
  • Standards compliant Java object oriented
    interface
  • WSDL2Java tool
  • Generate client stubs and service locator
  • SAAJ
  • Standards compliant XML oriented interface
  • SOAP with Attachments API for Java
  • Axiss proprietary API
  • Axis provides a proprietary XML oriented interface

15
Overview of JBossNetExample
  • The example consists of a set of simple counters
    (create, remove, set, get increase) which are
    available as web service.
  • The implementation of this service uses JAX-RPC
  • EJBs (CMP Entity Beans) to manage persistent
    state.
  • ant build script
  • Compilation of Java source
  • Creation of jar, wsr ear files
  • Deployment
  • JBoss-3.0.5 (based on axis-1.0-beta1)
Write a Comment
User Comments (0)
About PowerShow.com