Versions Compared

Key

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

We have support for the processing of XML headers or body elements through the use of the XStream library. XStream is idea when you have a bunch of POJOs and you want to stream them over XML.

If you are given a WSDL and want to create beans for it, we recommend a tool like XMLBeans, Castor or JAXB. However if you're starting with POJOs then XStream is nice & simple & fast.

The client API is pretty much the same as for the other marshalling tools. First off we have a regular interface that represents some service...

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

Now here's a REST client invoking a remote service..

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

Or the SOAP client looks like this

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

The server side

The following example demonstrates how to bind the server side implementation of a service to the some transport ready for being dispatched.

Here's a REST service example

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

Here's a SOAP service example

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

Dynamic client interface

You can avoid using service interfaces and dynamic proxies and just pass typed document POJOs around using the dynamic interface.

Here's a REST client example

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

Here's a SOAP client example

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