Skip to content
Carsten Stocklöw edited this page Jun 5, 2017 · 2 revisions

The SOAP sample (folder smp.ri.exportComponent) demonstrates a possible approach to export services from the service bus via web services to the external world. The web services are not secured and available to everyone who can access the web service interface.

The sample consists of:

  • service:
    Definition of the service to be exported. This is basically a Java interface with the methods that are to be exported.
  • server:
    Exporter of the service. The service definition is exported as OSGi service and (via Apache CFX) as web service. It implements the interface defined in the service component. When a method of this service is called, an appropriate request is issued on the service bus and the result is returned.
  • client:
    An example client that uses OSGi service to call a method from the server. Alternatively, a web service client could be used. The client only performs one simple call to turn off a light source at startup. If you want to use it again, you have to stop and re-start the bundle.
To make use of these components, a few more bundles are required; this is shown in the Run Configuration cxf LightingService_xx:
  • mvn:org.universaal.cxf.dosgi/org-universaal-cxf-dosgi/1.3.1:
    The Apache CFX components are required to export OSGi services as web services.
  • Lighting Server:
    As the SOAP server only acts as bridge between web service interface and the service bus, an actual implementation of the universAAL service is needed. In this example, the lighting server acts as provider of some simulated lamps.
  • Lighting Client:
    The SOAP client is intentionally very simple and can only turn off a registered light source (the URI of that light source is even hardcoded). The Lighting Client provides a more comfortable interface to control these light sources. You can turn on the light source and re-start the SOAP client to turn one of them off.