Exforsys

Home arrow Reviews arrow Java SOA Training

Servicemix http Lightweight Configuration

Author : Exforsys Inc.     Published on: 18th Jun 2008

servicemix-http Lightweight Configuration

In addition to the XBean-based configuration, servicemix-http can also be deployed based on the lightweight mode to use in an embedded ServiceMix. The configuration would be as follows:

Ads

 

Sample Code
  1. <sm:activationspec> <sm:component> <http:component> <http:endpoints> <http:endpoint soapaction="" wsdlresource="http://localhost:8080/
  2. AxisEndToEnd/services/
  3. HelloWebService?WSDL" locationuri="http://localhost:8080/
  4. AxisEndToEnd/services/HelloWebService" service="test:IHelloWebService" endpoint="HelloWebService" role="provider" soap="true"></http:endpoint> <http:endpoint defaultmep="http://www.w3.org/2004/08/" target="_blank" rel="nofollow"
  5. wsdl/in-out" targetservice="test:IHelloWebService" wsdlresource="http://localhost:8080/
  6. AxisEndToEnd/services/
  7. HelloWebService?WSDL" locationuri="http://localhost:8081/
  8. services/HelloWebService" service="test:MyConsumerService" endpoint="HelloWebService" role="consumer" soap="true"></http:endpoint> </http:endpoints> </http:component> </sm:component> </sm:activationspec>
Copyright exforsys.com


Web Service Binding Sample

We will now look at a complete sample of how to bind a web service to the ServiceMix. While doing so, we will also see how to use the Apache Axis client-side tools to generate stubs based on the binding at ServiceMix. Normally we point to the actual WSDL URL to generate client stubs, but in this example we will point the tools to the ServiceMix binding. Then the ServiceMix binding will act completely as the web service gateway visible to the external clients, thus shielding the actual web service in the background.

Sample Use Case

By using a web services gateway, you can use the intermediation to build and deploy the web services routing application. But keep in mind that the routing is just one of the various technical functionalities that you can implement at the gateway. For our sample use case, we have an external web service, deployed and hosted in a node remote to the ESB. In the ESB, we will set up a Web Services Gateway, which can proxy the remote web service. The entire setup is shown in the following figure:

Along with the previous discussion, we need the servicemix-http in the consumer and provider roles. MyConsumerService is a servicemix-http component in the consumer role and IHelloWebService is a servicemix-http component in the provider role. Both of them are shown in the following figure:

Let us now take a closer look at the gateway configured in the ESB. Here, we configure servicemix-http in both the consumer and provider roles and hook it to the NMR. Any client requests are intercepted by the consumer and the consumer then sends the request on behalf of the client to the NMR. From there the request will be routed to the destination web service through the provider. The message flow is marked in sequence in the following figure:

Ads



 
This tutorial is part of a Java SOA Training tutorial series. Read it from the beginning and learn yourself.

Java SOA Training

 

Comments