This page describes the WS-Notification support created for Java 1.4 using XMLBeans as the XML Marshalling layer.

We recommend you migrate to JAX-WS

Going forward we believe JAXB 2.0 is the idea XSD <=> Java mapping layer and JAX-WS the ideal API for working with web services. So going forward all of our WS-* implementations will use JAX-WS for its POJO and service interface creation.

We've left the XMLBeans code around in case folks need to use it but we recommend you migrate to WS Notification instead. Hopefully we can figure out how to patch something like Retroweaver to turn Java 5 specific code into a 1.4 binary so that folks can use JAX-WS and JAXB 2.0 on Java 1.4 JVMs. Incidentally it was the Java 5 dependency of JAXB 2.0 and JAX-WS that led us down the path of XMLBeans.

The WS-Notification support is currently implemented as a POJO; which can then either be called directly inside an application or can be wrapped up as a remote web service using some web service stack such as ActiveSOAP.

For more detail, try the javadocs

We have interfaces for the WS-Notification services in the org. servicemix.ws.notification package. These interfaces just depend on the XMLBeans generated from the WSDLs.

e.g. here's the NotificationConsumer interface

Using WS-Notification

To be able to publish or subscribe you need either a NotificationConsumer or NotificationBroker. The current implementation of both is the ActiveMQNotificationBroker - which will create a connection to an ActiveMQ broker (by default making an embedded broker inside the same JVM].

You can then publish WS-Notification messages as follows...

{snippet:id=notify|lang=java|url=http://cvs.servicemix.codehaus.org/servicemix/ws/src/test/java/org/servicemix/ws/xmlbeans/notification/impl/TestSupport.java?rev=HEAD}

You can perform a subscription as follows

{snippet:id=subscribe|lang=java|url=http://cvs.servicemix.codehaus.org/servicemix/ws/src/test/java/org/servicemix/ws/xmlbeans/notification/impl/TestSupport.java?rev=HEAD}

Runtime dependencies

Apart from the usual ActiveMQ dependencies (either client side only or full server side dependencies depending on if you're using an embedded broker) the WS-Notification provider has the following dependencies

  • xmlbeans-*.jar
  • StAX API (stax-api-*.jar)
  • a StAX implementation (either stax-ri-.jar or woodstox-.jar)
  • activesoap-*.jar (only required for invoking remote WS services when dispatching notifications)
  • No labels