You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Dave Meier <DM...@SERENA.com> on 2008/02/09 01:59:23 UTC

[AXIS2C] Questions about using REST

Hi Senaka, Samisa and Others,

I am now starting to implement REST style calls and have a couple
questions:

1.  It seems that a GET REST call only works if a query string with at
least one value is specified in the URI.  For example I want to do
"wsclient.exe -get
http://localhost:9090/axis2/services/aewebservices70/GetItem/111" to get
item "111" but that won't work.  I have to do "wsclient.exe -get
http://localhost:9090/axis2/services/aewebservices70/GetItem/111?foo=bar
" and then the request does get dispatched to my code.  Is there a way
around this?

2.  I don't know how to get at the values in the URL, like the "111"
value above which I have mapped like "<parameter
name="RESTLocation">GetItem/{itemid}</parameter>".  Do I look up
"itemid" somewhere in the message context?  I haven't done much with the
context so any code samples would be awesome.  If I want to get query
string values how do I do that?

Thank you for your help!

-Dave.

**********************************************************************
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. 
**********************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


RE: [AXIS2C] Questions about using REST

Posted by Dave Meier <DM...@SERENA.com>.
Thanks, Senaka.  My GET test is now working!

-Dave. 

-----Original Message-----
From: Senaka Fernando [mailto:senaka@wso2.com] 
Sent: Saturday, February 09, 2008 12:13 PM
To: axis-c-dev@ws.apache.org
Subject: Re: [AXIS2C] Questions about using REST

Hi again Dave,

I did fix two bugs in the code, with respect to REST, one of which you
reported, and another that indirectly affects. I also tested your
scenario calling the endpoint,

http://localhost:9090/axis2/services/echo/echoString/Hello/ using
Mozilla Firefox, which returned,

<ns1:echoString>
<text>Hello</text>
</ns1:echoString>

Please do try now, I believe it should work for you.

Regards,
Senaka

> Hi Dave,
>
> Unless it is a bug somewhere in the code, that we could not track, you

> are capable of calling 
> http://localhost:9090/axis2/services/aewebservices70/GetItem/111, and 
> getting the request dispatched. I will check into this and get it
fixed.
>
> Also, I believe if you setup RESTLocation, as in the way you say 
> below, your itemid will get added to your payload (the axiom_node that
you get).
> It may reside either at the top (before the query parameter info) or 
> the bottom (after the query parameter info) of your payload, depending

> on the way it got dispatched. However, you can access that information

> in the very same way you access a query parameter. So, try to browse 
> through your node.
>
> Also, as it is very hard to figure out a clear-cut specification on 
> REST fot Web Services, other than of course the HTTP-Binding in the 
> WSDL2.0 and WADL from which we got an insight, you are welcome to 
> express your thoughts for additions and improvements to the REST logic

> in the Axis2/C engine.
>
> Regards,
> Senaka
>
>> Hi Senaka, Samisa and Others,
>>
>> I am now starting to implement REST style calls and have a couple
>> questions:
>>
>> 1.  It seems that a GET REST call only works if a query string with 
>> at least one value is specified in the URI.  For example I want to do

>> "wsclient.exe -get 
>> http://localhost:9090/axis2/services/aewebservices70/GetItem/111" to 
>> get item "111" but that won't work.  I have to do "wsclient.exe -get 
>> http://localhost:9090/axis2/services/aewebservices70/GetItem/111?foo=
>> bar " and then the request does get dispatched to my code.  Is there 
>> a way around this?
>>
>> 2.  I don't know how to get at the values in the URL, like the "111"
>> value above which I have mapped like "<parameter 
>> name="RESTLocation">GetItem/{itemid}</parameter>".  Do I look up 
>> "itemid" somewhere in the message context?  I haven't done much with 
>> the context so any code samples would be awesome.  If I want to get 
>> query string values how do I do that?
>>
>> Thank you for your help!
>>
>> -Dave.
>>
>> *********************************************************************
>> * This email and any files transmitted with it are confidential and 
>> intended solely for the use of the individual or entity to whom they 
>> are addressed.
>> Any unauthorized review, use, disclosure or distribution is
prohibited.
>> If
>> you are not the intended recipient, please contact the sender by 
>> reply e-mail and destroy all copies of the original message.
>> *********************************************************************
>> *
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Re: [AXIS2C] Questions about using REST

Posted by Senaka Fernando <se...@wso2.com>.
Hi again Dave,

I did fix two bugs in the code, with respect to REST, one of which you
reported, and another that indirectly affects. I also tested your scenario
calling the endpoint,

http://localhost:9090/axis2/services/echo/echoString/Hello/ using Mozilla
Firefox, which returned,

<ns1:echoString>
<text>Hello</text>
</ns1:echoString>

Please do try now, I believe it should work for you.

Regards,
Senaka

> Hi Dave,
>
> Unless it is a bug somewhere in the code, that we could not track, you are
> capable of calling
> http://localhost:9090/axis2/services/aewebservices70/GetItem/111, and
> getting the request dispatched. I will check into this and get it fixed.
>
> Also, I believe if you setup RESTLocation, as in the way you say below,
> your itemid will get added to your payload (the axiom_node that you get).
> It may reside either at the top (before the query parameter info) or the
> bottom (after the query parameter info) of your payload, depending on the
> way it got dispatched. However, you can access that information in the
> very same way you access a query parameter. So, try to browse through your
> node.
>
> Also, as it is very hard to figure out a clear-cut specification on REST
> fot Web Services, other than of course the HTTP-Binding in the WSDL2.0 and
> WADL from which we got an insight, you are welcome to express your
> thoughts for additions and improvements to the REST logic in the Axis2/C
> engine.
>
> Regards,
> Senaka
>
>> Hi Senaka, Samisa and Others,
>>
>> I am now starting to implement REST style calls and have a couple
>> questions:
>>
>> 1.  It seems that a GET REST call only works if a query string with at
>> least one value is specified in the URI.  For example I want to do
>> "wsclient.exe -get
>> http://localhost:9090/axis2/services/aewebservices70/GetItem/111" to get
>> item "111" but that won't work.  I have to do "wsclient.exe -get
>> http://localhost:9090/axis2/services/aewebservices70/GetItem/111?foo=bar
>> " and then the request does get dispatched to my code.  Is there a way
>> around this?
>>
>> 2.  I don't know how to get at the values in the URL, like the "111"
>> value above which I have mapped like "<parameter
>> name="RESTLocation">GetItem/{itemid}</parameter>".  Do I look up
>> "itemid" somewhere in the message context?  I haven't done much with the
>> context so any code samples would be awesome.  If I want to get query
>> string values how do I do that?
>>
>> Thank you for your help!
>>
>> -Dave.
>>
>> **********************************************************************
>> This email and any files transmitted with it are confidential and
>> intended
>> solely for the use of the individual or entity to whom they are
>> addressed.
>> Any unauthorized review, use, disclosure or distribution is prohibited.
>> If
>> you are not the intended recipient, please contact the sender by reply
>> e-mail and destroy all copies of the original message.
>> **********************************************************************
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Re: [AXIS2C] Questions about using REST

Posted by Senaka Fernando <se...@wso2.com>.
Hi Dave,

Unless it is a bug somewhere in the code, that we could not track, you are
capable of calling
http://localhost:9090/axis2/services/aewebservices70/GetItem/111, and
getting the request dispatched. I will check into this and get it fixed.

Also, I believe if you setup RESTLocation, as in the way you say below,
your itemid will get added to your payload (the axiom_node that you get).
It may reside either at the top (before the query parameter info) or the
bottom (after the query parameter info) of your payload, depending on the
way it got dispatched. However, you can access that information in the
very same way you access a query parameter. So, try to browse through your
node.

Also, as it is very hard to figure out a clear-cut specification on REST
fot Web Services, other than of course the HTTP-Binding in the WSDL2.0 and
WADL from which we got an insight, you are welcome to express your
thoughts for additions and improvements to the REST logic in the Axis2/C
engine.

Regards,
Senaka

> Hi Senaka, Samisa and Others,
>
> I am now starting to implement REST style calls and have a couple
> questions:
>
> 1.  It seems that a GET REST call only works if a query string with at
> least one value is specified in the URI.  For example I want to do
> "wsclient.exe -get
> http://localhost:9090/axis2/services/aewebservices70/GetItem/111" to get
> item "111" but that won't work.  I have to do "wsclient.exe -get
> http://localhost:9090/axis2/services/aewebservices70/GetItem/111?foo=bar
> " and then the request does get dispatched to my code.  Is there a way
> around this?
>
> 2.  I don't know how to get at the values in the URL, like the "111"
> value above which I have mapped like "<parameter
> name="RESTLocation">GetItem/{itemid}</parameter>".  Do I look up
> "itemid" somewhere in the message context?  I haven't done much with the
> context so any code samples would be awesome.  If I want to get query
> string values how do I do that?
>
> Thank you for your help!
>
> -Dave.
>
> **********************************************************************
> This email and any files transmitted with it are confidential and intended
> solely for the use of the individual or entity to whom they are addressed.
> Any unauthorized review, use, disclosure or distribution is prohibited. If
> you are not the intended recipient, please contact the sender by reply
> e-mail and destroy all copies of the original message.
> **********************************************************************
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org