Versions Compared


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

Here is an example of an interface to a service. Note that the interface is optional, you can expose a class as a service - we've just used an interface in this example as its good practice and makes the example easier to follow.

Wiki Markup

Here's the WSDL that this service matches. Note that we hope to provide an extension to XMLBeans to allow this service interface to be auto-generated at the same time you auto-generate the XMLBeans from a WSDL.

There's a method on this interface which accepts an XMLBeans type and represents a WSDL operation. We can have as many methods as we like all auto-published, the only requirement is that when using the XMLBeansRegistery, the parameter must be an XMLBeans type, so that when we register it we can auto-deduce the QName which matches the correct method on the service.

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

Exposing services over HTTP

The following example demonstrates how to make a service available over HTTP using the SOAP protocl (1.2 is the default)

Wiki Markup

Here is the same service exposed as a pure REST service

Wiki Markup

Client interface

As well as implementing web services, its also useful to be able to invoke them easily in a document centric way.

The following example demonstates how to invoke a web service using an XMLBeans interface for a WSDL endpoint.

Wiki Markup

Here's the same thing again for a service exposed via pure REST

Wiki Markup

Another alternative is to use the Dynamic client API.