Free Training


C Language  |  CSS  |  MainFrame  |  VBScript  |  PHP  |  XML  |  C++ Tutorials  |  Ajax  |  JavaScript  |  CSS3  |  UML  |  jQuery  |  Microsoft AJAX

Java SOA Tutorials

 
Home Tutorials Java SOA
 

servicemix 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:




Sample Code
  1. <sm:activationspec>
  2. <sm:component>
  3. <http:component>
  4. <http:endpoints>
  5. <http:endpoint soap="true" role="provider" endpoint="HelloWebService"
  6. service="test:IHelloWebService" locationuri="http://localhost:8080/
  7. AxisEndToEnd/services/HelloWebService" wsdlresource="http://localhost:8080/
  8. AxisEndToEnd/services/
  9. HelloWebService?WSDL" soapaction="></http:endpoint>
  10. <http:endpoint soap="true" role="consumer" endpoint="HelloWebService"
  11. service="test:MyConsumerService" locationuri="http://localhost:8081/
  12. services/HelloWebService" wsdlresource="http://localhost:8080/
  13. AxisEndToEnd/services/
  14. HelloWebService?WSDL" targetservice="test:IHelloWebService"
  15. defaultmep="http://www.w3.org/2004/08/" target="_blank" rel="nofollow"
  16. wsdl/in-out"></http:endpoint>
  17. </http:endpoints>
  18. </http:component>
  19. </sm:component>
  20. </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:





Read Next: Deploy the Web Service



 
Related Topics

Related Jobs


 

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
September 15, 2008, 4:25 am

Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Weekly Offers

Sponsored Links