Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

These properties are set on the Service Registration in the OSGi Service Registry.

Service Provider properties For Configuring SOAP-based services and consumers

Note: for backwards compatibility old values marked below are still supported.

...

Property Name

Data Type

Example

Description

org.apache.cxf.ws.address
(previously:osgi.remote.configuration.pojo.address)

String

{{

http://localhost:9090/greeter

}}

The address at which the service with be made available remotely. If this property is not specified, this defaults to {{

http://localhost:9000/fully/qualified/ClassName

}}.

org.apache.cxf.ws.httpservice.context
(previously:osgi.remote.configuration.pojo.httpservice.context)

String

/auction

When this property is specified, the OSGi HTTP Service is used to expose the service, rather than a dedicated Jetty HTTP Server. This property doesn't allow the specification of a port number, as this is provided by the HTTP Service. The Distributed OSGi distributions come with Pax-Web, for which configuration information can be found here:

http://wiki.ops4j.org/display/paxweb/Configuration

, however other OSGi HTTP Service implementations are potentially configured differently.

Service Provider properties For Configuring RESTful JAXRS-based endpoints and consumers

org.apache.cxf.rs configuration type

When the service.exported.configs=org.apache.cxf.rs property is specified, the following properties may also be specified.

Property Name

Data Type

Example

Description

org.apache.cxf.rs.address

String

{{

http://localhost:9090/greeterImage Added

}}

The address at which the service with be made available remotely. If this property is not specified, this defaults to {{

http://localhost:9000/fully/qualified/ClassNameImage Added

}}.

org.apache.cxf.rs.httpservice.context

String

/auction

When this property is specified, the OSGi HTTP Service which is used to expose the service, rather than a dedicated Jetty HTTP Server. By default, absolute address may look like 'http://localhost:8080/auction'

org.apache.cxf.rs.provider

Boolean

true} or {false

Can be used to identify a global JAXRS provider as CXF-compatible

org.apache.cxf.rs.provider.expected

Boolean

true} or {false

Can be used to require global providers to set an 'org.apache.cxf.rs.provider' property with a value 'true'.

org.apache.cxf.rs.provider.globalquery

Boolean

true} or {false

Can be used to disable queries for global providers, defaults to 'true'.

Registering custom JAXRS providers

Custom JAXRS providers including CXF-specific providers can be registered like regular OSGI services, for example :

Code Block
java
java

Object provider = new CustomMessageBodyReaderWriter();
bundleContext.registerService(
  new String[]{"javax.ws.rs.ext.MessageBodyReader", "javax.ws.rs.ext.MessageBodyReader"}, provider);

Note that when registering a global provider, one may set an 'org.apache.cxf.rs.provider.expected' on a given service description thus requiring providers to confirm that they will reliably work with CXF JAX-RS by setting a 'org.apache.cxf.rs.provider' true property during the registration - this may be needed when multiple JAX-RS implementations are available and some custom providers depending on JAXRS implementation specific code.

Alternatively, one can register per-service specific providers during the application service registration :

Code Block
java
java

CustomMessageBodyReaderWriter provider1 = new CustomMessageBodyReaderWriter();
provider.setCustomProperty(true);
CustomMessageBodyReaderWriter provider2 = new CustomMessageBodyReaderWriter();
provider2.setCustomProperty(false);

Dictionary properties = new Hashtable();
properties.put("org.apache.cxf.rs.provider", provider);

Dictionary properties2 = new Hashtable();
properties.put("org.apache.cxf.rs.provider", provider2);


bundleContext.registerService(
  new String[]{"org.books.BookService"}, new BookServiceImpl(), properties);
bundleContext.registerService(
  new String[]{"org.books.BookService"}, new AdvancedBookServiceImpl(), properties2);

Service Consumer properties

On client side proxies, typically the same properties are set as on set service provider side for both SOAP and RESTful clients. There are some additional properties too. Since the client-side proxy is registered by the DOSGi implementation, all these properties are read-only.

...