Java SOA Tutorials
Tutorials
Java SOAservicemix http Lightweight Configuration
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:
- <sm:activationspec>
- <sm:component>
- <http:component>
- <http:endpoints>
- <http:endpoint soap="true" role="provider" endpoint="HelloWebService"
- service="test:IHelloWebService" locationuri="http://localhost:8080/
- AxisEndToEnd/services/HelloWebService" wsdlresource="http://localhost:8080/
- AxisEndToEnd/services/
- HelloWebService?WSDL" soapaction="></http:endpoint>
- <http:endpoint soap="true" role="consumer" endpoint="HelloWebService"
- service="test:MyConsumerService" locationuri="http://localhost:8081/
- services/HelloWebService" wsdlresource="http://localhost:8080/
- AxisEndToEnd/services/
- HelloWebService?WSDL" targetservice="test:IHelloWebService"
- defaultmep="http://www.w3.org/2004/08/" target="_blank" rel="nofollow"
- wsdl/in-out"></http:endpoint>
- </http:endpoints>
- </http:component>
- </sm:component>
- </sm:activationspec>
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:

Comments
giorgio said:
|
Hi all, How can i handle SOAP messages in this scenario using java? how use java classes to intercept soap messages going from client to server? thanks |
Weekly Offers
Sponsored Links
