Friday, July 07, 2006

 
Understanding the 'soap-binding' (http://www.servicemix.org/site/soap-binding-example.html) example

The soap-binding example aims to demonstrate how one can use the Servicemix-http and servicemix-jsr181 components to invoke a pojo object as a web service over HTTP.

Here is a breakdown of what happens when you hit the 'send' button on the client.html page.
SOAP REQEST
  1. When send button is clicked, a javascript function(send()) is invoked.

  2. The javascript function submits an Ajax request to the http endpoint deployed using the serviceunit(binding-su.zip) on the Servicemix-http component.The soap request present in the textfield on the left hand side is sent a parameter to Ajax request.

  3. The Httpendpoint receives the http+soap request and sends the request to the 'proxied' pojo endpoint(proxied endpoint references are shown in bold in the excerpt below) deployed using engine-su.zip over the NMR.

  4. Here is the excerpt from the xbean.xml file under
    {Serivemix installation directory}\servicemix-3.0-M1\examples\soap-binding\src\components\soap
    http:endpoint service="demo:simple-service"
    endpoint="simple-service"
    role="consumer"
    locationURI="http://localhost:8192/Service/"
    defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
    soap="true" />
  5. The servicemix-jsr181 receives the request from the NMR and invokes the 'SimpleService' pojo' 'ping' method.

  6. The 'SimpleService' returns the response to the 'ping' method and servicemix-jsr181 sends to response back the Httpendpoint over the NMR.

  7. Here is the excerpt of the implemenation for the ping method
    public PingResponse ping(PingRequest request) {
    PingResponse response = new PingResponse();
    response.setMessage("Ping: " + request.getMessage());
    return response;
    }

    This method prefixes a "Ping:" to request recieved and sends it back as the response
  8. The Servicemix-http sends the response back the browser instance from which the ajax request was sent.

  9. The browser invokes java script function that sets the response field value to the response received.



There are some subtle points to note here

  1. The proxied endpoint is configured using the service="demo:simple-service" and endpoint="simple-service" attributes in the http:endpoint configuration in the binding-su's xbeans.xml file. The values demo:simple-service and simple-service point to service name and endpoint name of the pojo endpoint configuration( service="demo:simple-service" endpoint="simple-service" attributes of jsr181:endpoint configuration) in engine-su's xbean.xml file.

  2. The Servicemix-http and servicemix-jsr181 components are installed at runtime and not using the servicemix.xml file under [servicemix-home]\examples\soap-binding folder.


Comments:
Section 6.3 of the jbi spec mandates service units to have a deployment descriptor too.

However, I dont think the soap example has one and I dont think the xbean.xml qualifies for one either.

Can you shed some light on this?

-Ryan
 
hi,

Can you please send me the project source code detail for this example to my yahoo account.

pksahoo@yahoo.com
 
Hi Vamsi, Happy about your blog. Do you have idea in working with clusters in ServiceMix.

Help out if you are aware.

regards
Guru
 
Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?