axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samisa Abeysinghe <>
Subject Re: How to dispatch to a REST service?
Date Fri, 15 Sep 2006 05:52:38 GMT
Jean-Sebastien Delfino wrote:
> Hi,
> I'm using the REST support in Axis2C 0.93 to invoke SCA services in 
> Apache Tuscany, and it has been working pretty well so far. I now 
> would like to customize a little how requests get dispatched to a 
> particular service.
> I am currently using the following URL: 
> http://localhost:9090/axis2/services/customer?id=1234 to invoke my 
> customer info Web service and pass to it customer id 1234, so far so 
> good.
> Now I would like to change this a little and invoke the customer info 
> service using a slightly different URL: 
> http://localhost:9090/axis2/services/customer/1234. Customer id 1234 
> is now specified as part of the path instead of a parameter. I still 
> need a single service for all customers, and the ability to get the 
> customer id in the Axis2 service skeleton.
> Is this possible? 
This is not possible as of now, as we are dependent on the '?' 
separation for parameters.
> What do I need to put in my services.xml to enable this? and how will 
> I get the part of the URL after customer/ in my Axis2 service skeleton?
Unfortunately we have not implemented a mechanism for this. In theory, 
you should be able to write your own dispatcher to get this done. e.g. 
see modules/core/engine/req_uri_disp.c. You write a custom dispatcher 
and include that extended dispatcher in "<phaseOrder type="inflow">" 
section's 'Dispatch' phase in axis2.xml. However we have not tested 
plugging in dispatchers.
Alternatively, you can extend the logic in axis2_req_uri_disp_find_op 
method of modules/core/engine/req_uri_disp.c. and get the rest of the 
string after customer/ in the URI and set this as a property in the 
message context. Then, in the service skeleton, you can pull this 
property from the message context. I think this approach is simpler than 
to try and write a custom dispatcher.


> Thanks...

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message