Versions Compared

Key

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

...

Code Block
// optional endpoint resolution 
EndpointResolver resolver = client.createResolverForService(service);

Map properties = new HashMap();
properties.put("name", "James");

Object response = client.request(resolver, null, properties, "<hello>world</hello>");

Configuring the ServiceMixClient

We use the Spring XML configuration files to configure the client. You can then use dependency injection to inject the client into your POJOs.

Here's an example of using a basic client...

Wiki Markup
{snippet:id=client|lang=xml|url=http://cvs.servicemix.codehaus.org/*checkout*/servicemix/base/src/test/resources/org/servicemix/client/example.xml?rev=HEAD}

Note that the jbi bean reference is the ServiceMix JBI container.

This example creates a client which is hard-wired to default to a specific service when an invocation is performed.

Wiki Markup
{snippet:id=clientroute|lang=xml|url=http://cvs.servicemix.codehaus.org/*checkout*/servicemix/base/src/test/resources/org/servicemix/client/example.xml?rev=HEAD}