You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Shantaram Nadkarni <sn...@copyright.com> on 2007/12/19 20:50:01 UTC

Web service with REST

Hi

  I am currently having issue with some of the services I have
implemented with REST enabled.  With SOAP, all the operations are
working fine, but with REST there are couples of operations that do not
work.

As I understand, axis2 converts the REST/HTTP request to a SOAP message.

 

I have RawXMLINOutMessageReceiver as the message receiver.

 

Requests that work fine have the following xml structure defined in the
WSDL.

<a>

  <b/>

</a>

In this case I am able to access the OMElement node b within the saop
body.

The URL provided in the browser looks like

http://domain/service/MyService/a

 

 

Requests that have issues are of the following structure

<a>

  <b>

     <c/>

     <d/>

  </b>

</a>

In this case, the soap message is created with only "a" and "b" as the
OMElement node. The "c" and "d" nodes are not created during the
conversion.

The URL provided in the browser looks like

http://domain/service/MyService/a?c=sample&d=free

 

I would like to understand the REST architecture within axis2 and how
the request parameters are mapped to the actual xml structure defined in
WSDL.

 

Any help will be appreciated.

 

Thanks

Shantaram


Re: Web service with REST

Posted by keith chapman <ke...@gmail.com>.
Hi,

What is the axis2 version you are using? Can you try this out with the
latest SNAPSHOT cause I added some code to ?wsdl2 to show the operation
styles it can support. Axis2s REST support is based on the WSDL
2.0HTTPBinding. Please have a look at this section
http://www.w3.org/TR/wsdl20-adjuncts/#_http_x-www-form-urlencoded in the
WSDL 2.0 adjuncts spec. It says the conditions that enable parameters to be
serialized in the URL. These conditions are based on the ability to
reconstruct the required data on the server side. Now if you use the
SNAPSHOT build of axis2 and you check ?wsdl2 you would see which operations
have the IRI style. The style is described in the interface operation.

I hope that this information would help you understand that not all
operations can support the IRI style. There are limitations as to how
parameters can be sent on the url. If you need a truly REST service you will
have to take these into consideration and design your inputs so that they
can be serialized in the URL.

Thanks,
Keith.

On Dec 20, 2007 1:20 AM, Shantaram Nadkarni <sn...@copyright.com> wrote:

>  Hi
>
>   I am currently having issue with some of the services I have implemented
> with REST enabled.  With SOAP, all the operations are working fine, but with
> REST there are couples of operations that do not work.
>
> As I understand, axis2 converts the REST/HTTP request to a SOAP message.
>
>
>
> I have RawXMLINOutMessageReceiver as the message receiver.
>
>
>
> Requests that work fine have the following xml structure defined in the
> WSDL.
>
> <a>
>
>   <b/>
>
> </a>
>
> In this case I am able to access the OMElement node b within the saop
> body.
>
> The URL provided in the browser looks like
>
> http://domain/service/MyService/a
>
>
>
>
>
> Requests that have issues are of the following structure
>
> <a>
>
>   <b>
>
>      <c/>
>
>      <d/>
>
>   </b>
>
> </a>
>
> In this case, the soap message is created with only "a" and "b" as the
> OMElement node. The "c" and "d" nodes are not created during the conversion.
>
> The URL provided in the browser looks like
>
> http://domain/service/MyService/a?c=sample&d=free
>
>
>
> I would like to understand the REST architecture within axis2 and how the
> request parameters are mapped to the actual xml structure defined in WSDL.
>
>
>
> Any help will be appreciated.
>
>
>
> Thanks
>
> Shantaram
>



-- 
Keith Chapman
WSO2 Inc.
Oxygen for Web Services Developers.
http://wso2.org/