1 Reply Latest reply on Jun 15, 2007 3:19 PM by Tom Fennelly

    Exposing JBossWS Webservice Endpoints...

    Tom Fennelly Master

      OK, I eventually got the 4.2 codebase updated to use the JBossWS 2.0.0 codebase. This required changes to the JBossWS 2.0.x codebase, as well as to the ESB.

      The main changes of note are:
      1) All the SOAP/Webservice components are now out of the listeners module and out in their own "soap" service (in the services dir).
      2) The JBossWSAdapter now supports configuration with "JAXB Introductions" for interfaces that are not JAXB annotated.
      3) The webservice_bpel quickstart is back in and working now (using JAXB introductions).

      JAXB Introductions
      Because JBossWS 2.x is now using JAXB to marshal and unmarshal SOAP message payloads. JAXB requires the Java bindings to be annotated. This causes an issue on the ESB where we want to expose existing interfaces as webservices, where those interfaces are not already JAXB annotated.

      The solution we have is to allow specification of the annotations in XML. Yep, sounds odd, since one of the main reasons for annotations is to get rid of XML.

      The XML looks like this:

      <?xml version = "1.0" encoding = "UTF-8"?>
      
      <jaxb-intros xmlns="http://jbossesb.jboss.com/xsd/jaxb-intros">
      
       <!--
       JAXB annotation introductions for CustomerOrder messages.
       -->
      
       <!--
       The type namespaces on the customerOrder are different from the rest of the message...
       -->
       <class-intro-config name="com.activebpel.ordermanagement.CustomerOrder">
       <method-intro-config name="get.*">
       <XmlElementIntro namespace="http://org.jboss.esb/quickstarts/bpel/ABI_OrderManager" />
       </method-intro-config>
      
       </class-intro-config>
      
       <!--
       More general namespace config for the rest of the message...
       -->
       <class-intro-config name="com.activebpel.ordermanagement.*">
       <method-intro-config name="get.*">
       <XmlElementIntro namespace="http://ordermanagement.activebpel.com/jaws" />
       </method-intro-config>
       </class-intro-config>
      
      </jaxb-intros>
      


      Basically the configuration allows you to specify 3 of the JAXB annotations (@XmlType, @XmlElement and @XmlAttribute) in XML and target them at specific classes, methods and fields. If you look at the definitions for these annotations and compare them with their equivalent XML representation (XmlTypeIntro etc. - example above), you'll see that they match up exactly.

        • 1. Re: Exposing JBossWS Webservice Endpoints...
          Tom Fennelly Master

          Ups, hit send by accident. Anyway...

          One thing you might notice about the configuration is that it supports regular expressions in the class, method and field names. This means you can write more generalised configurations e.g. introducing a namespace @XmlElement annotation on all getter methods (or fields) from all classes in a particular package.

          Here's the XSD for the config.

          The webservice_bpel quickstart is a good example of where this is in use.

          BTW: I've posted a request for other alternatives to this approach on the JAXB forums, but haven't received any feedback as yet.

          I'm off to enjoy a week off now :-)