Senaka Fernando wrote:
Hi all,

After discussing with Axis2/Java folk, I believe that we should improve
the services.xml to support RESTful Services as we don't have a WSDL2.0
mode. This is the proposed scheme.

[1]. Adding a local http_location mapping for each operation:

    <operation name="foo">
            <parameter name="HTTPMethod" >PUT</parameter>
            <parameter name="HTTPLocation" >foo/bar/{x}/{y}</parameter>
    </operation>

These are REST specific parameters. With or without those in place, SOAP should also work, as it used to be. I do think the parameter names should reflect that they are REST specific. Otherwise the user will confuse them with SOAP cases as well.
So why not prefix them with REST.

Also, should we not be able to expose the same service operation, e,g, foo, with multiple HTTP methods? How are we supposed to handle that with this syntax? If we combine HTTP method with location, I think we can handle that case
e.g.

   <operation name="foo">
           <parameter name="REST">PUT:foo/barp/{x}/{y}</parameter>
           <parameter name="REST">GET:foo/barg/{a}/{b}</parameter>
   </operation>

Would that be really RESTful?

Also, I was wondering, in case of POST and PUT, do we need {x}/{y} part? Becuase the payload comes in the request body. I think it is only GET and DELETE need those {} parts. Am I missing something here?

Thanks,
Samisa...
[2]. Specification of the default HTTPMethod for a service:

    <parameter name="HTTPMethod" locked="xsd:false">GET</parameter>

[3]. This is the explanation of HTTPLocation parameter.

1. This is the trailing portion of the URL after the service name.
2. This may or may not start with the operation name.
3. This may include constant portions and variable portions.
4. Variable portions are included inside '{' '}' (curly braces).
5. Curly braces are escaped as {{ or }}.
6. Escaping of curly braces adds another limitation, being we can't
specify constant portions inside a variable portion and vice versa.
7. Separation of portions is done by '/'s.
8. HTTPLocation can include query-string portions that need 2 be matched.
9. Thus, someone can make the order of the query string parameters
significant.
10. Un-specified areas are not captured.

This is a sample RESTful services' service.xml:

<service name="sample">
    <parameter name="HTTPMethod" locked="xsd:false">GET</parameter>
    <description>
            This is a sample service.
    </description>
    <operation name="foo">
            <parameter name="HTTPMethod" >PUT</parameter>
            <parameter name="HTTPLocation" >foo/bar/{x}/{y}</parameter>
    </operation>
</service>

[4]. This is a sample request to this service
  ex:- http://localhost:9090/sample/foo/bar/12/14?query

Please add your comments and suggestions.

Regards,
Senaka

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to