1 / 15

JBoss Web Services

JBoss Web Services. Stuart Wheater Arjuna Technologies. 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

johncbailey
Télécharger la présentation

JBoss Web Services

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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/projects/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 IBM’s 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 • Axis’s 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 “java:RPC” • Other features: • Standards compliant API for Lifecycle event notification: init() and destroy() • Standards compliant API for request and response interception

  8. Axis’s 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.MessageContext, java.util.Vector) • org.w3c.dom.Document method(org.w3c.dom.Document) • org.w3c.dom.Document method(org.apache.axis.MessageContext, org.w3c.dom.Document) • org.w3c.dom.Document method(org.apache.axis.MessageContext) • 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 “java:MSG”

  9. Axis’s Ultra-low-level Service Interface • Axis provides a raw engine interface • Register own “provider class” • Extension of the org.apache.axis.providers.BasicProvider class • void invoke(org.apache.axis.MessageContext) • void generateWSDL(org.apache.axis.MessageContext) • . . . • In deployment descriptor: • <service … provide=“java:org.eu.adapt.AdaptableProvider”>

  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 • <jboss home>/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 • <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> <service name="JAXRPCCountersService" provider="java:RPC"> <parameter name="className“ value="org.eu.adapt.wsexample.ws.JAXRPCCountersImpl"/> <parameter name="allowedMethods" value="create remove set get increase"/> <parameter name="scope" value="Application"/> </service></deployment> • Request, response and fault interceptors • <requestFlow> <handler . . ./></requestFlow>

  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: • <jboss home>/server/all/deploy/jboss-net.sar • Then run AdminClient with web service’s 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. • <module><java>wsexample.wsr</java></module>

  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 • Axis’s 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)

More Related