Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

XMLBeans is a tool for handling typically XSD typed XML with support for the autogenerating of beans to map to a WSDL or XSD file.

We have an XMLBeanHandler in the XMLBeans packageyou can derive from if you wish to stay close to the metal.

Alternatively we've an XMLBeansRegistry which you can use with a RestService or SoapService to bind any service instances which can process incoming XMLBeans document types and possibly process some output.

Here is an example application which demonstrates writing a simple POJO based services using purely XMLBeans and letting ActiveSOAP be the REST or SOAP stack and handling the HTTP or JMS transports for you.

First you need some kinda service to expose. So we wrote a little interface.

Wiki Markup
{snippet:id=example|lang=java|url=http://cvs.activesoap.codehaus.org/viewrep/~raw,r=HEAD/activesoap/activesoap/src/test/org/codehaus/activesoap/examples/snowboard/SnowboardService.java}

There's a method on this interface which accepts an XMLBeans type. We can have as many methods as we like all auto-published, the only requirement is that the parameter must be an XMLBeans type, so that when we register it with XMLBeansRegistry it can auto-deduce the QName which matches the XMLBean type.

Then if we register an implementation of this interface with the XMLBeansRegistry we can automatically publish the service as both REST and SOAP endpoints...

Wiki Markup
{snippet:id=example|lang=java|url=http://cvs.activesoap.codehaus.org/viewrep/~raw,r=HEAD/activesoap/activesoap/src/test/org/codehaus/activesoap/examples/snowboard/SnowboardTest.java}