axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Subra A Narayanan" <>
Subject Re: REST with Axis2/C
Date Mon, 27 Aug 2007 02:57:06 GMT

I have been looking at the code that you pointed me to and trying to figure
out how REST works. Right now, the method name needs to be in the URL for
REST to work. To make Axis2/C more RESTful, we would need a way to map HTTP
methods and keywords in the URI to map to webservice method names. I will
take amazon s3  service to explain what I mean. Look at the following 2

#1 get object request

GET /[bucket-name]/[key-name] HTTP/1.0
Date: Wed, 08 Mar 2006 04:06:18 GMT
Authorization: AWS [aws-access-key-id]:[header-signature]

#2 delete object request

DELETE /[bucket-name]/[key-name] HTTP/1.0
Date: Wed, 08 Mar 2006 04:06:19 GMT
Authorization: AWS [aws-access-key-id]:[header-signature]

The above 2 requests look exactly the same except for their HTTP methods:
GET vs DELETE. In Axis2/C I think we would need a way to may HTTP method
name/key word in URI to be mapped to a webservice operation name so that the
soap request can be formed accordingly.

Do you have suggestions as to how this can be done in a generic way?


On 8/23/07, Samisa Abeysinghe <> wrote:
> Dinesh Premalal wrote:
> > Hi Subra,
> > "Subra A Narayanan" <> writes:
> >
> >> So the solution looks like writing an Apache module (I have never
> written one
> >> before) which receives the REST request, translates the request to a
> >> request and then forwards it on to Axis2/c. But this is exactly what
> Axis2/C is
> >> also doing.
> >>
> > Yes, that is also a possibility. However I think it will be quite
> > arduous to maintain two apache modules in the long run. I would rather
> > like improving Axis2/C REST support.
> >
> I too think that it would be much simpler to improve the current REST
> support rather than to implement another Apache module.
> If you look at the apache module implementation, in source file
> src/core/transport/http/server/apache2/apache2_worker.c, there is a
> method named axis2_apache2_worker_process_request. If you have a look at
> this, then you can understand how GET and POST requests are dealt with
> and in turn, this function calls the methods
> axis2_http_transport_utils_process_http_get_request and
> axis2_http_transport_utils_process_http_post_request methods deal with
> detailed request processing, including REST stuff. So if you want PUT
> and DELETE you can implement new functions like,
> axis2_http_transport_utils_process_http_put_request and
> axis2_http_transport_utils_process_http_delete_request. Also, if you
> want to deal with the media types, before control is passed on to
> Axis2/C, I hope you can do that within
> axis2_apache2_worker_process_request function, as you have access to the
> request information there.
> The above are just few suggestions, to use the current apache module
> code and improve that to deal with more REST stuff. However, I did not
> look into that in detail. If you try that and have more questions please
> feel free to ask this list.
> Thanks,
> Samisa...
> >> I want to start looking in to improving REST support in Axis2/C. Is
> >> it doable?
> >>
> > Yes, It is.
> >
> >> Am I missing something very obvious which would prevent us from
> implementing
> >> such support in Axis2? If not please let me know as to where I should
> start
> >> looking in the Axis2 source.
> >>
> > You could start at looking HTTP transport I guess. If you could debug
> > echo_rest sample, it will be helpful to understand the underlying
> > logic.
> >
> > thanks,
> > Dinesh
> >
> --
> Samisa Abeysinghe : WSO2 WSF/C
> "
> "
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message