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 An...@mro.com on 2006/06/27 16:43:02 UTC

[Axis2] rest question

Hi
As per the axis2 doc it seems that if I want to do a POST rest service -
the only way axis runtime would detect which method to delegate the call to
is from the name of the top level element in the http message body XML -
right?
I have a service whose method definition is like

public OMElement dothis(OMElelemt payload)

When I do the SOAP client  invoke I send the soap action as urn:dothis and
my payload top element does not match the method name - This works fine
with axis2.

But now if I have to do REST call and not have the root element as method
name - how can I acheive that using rest? [I presume soap action is not
going to work here or is it?]

thanks
Anamitra


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


Re: [Axis2] rest question

Posted by Anne Thomas Manes <at...@gmail.com>.
And another really good illustration about REST. REST is an architectural
style in which the central theme is resources (not methods).
http://www.innoq.com/blog/st/2006/06/30/rest_vs_soap_oh_no_not_again.html

Anne

On 6/29/06, Anne Thomas Manes <at...@gmail.com> wrote:
>
> Here's a useful guide to understanding REST:
> http://prescod.net/rest/Steps_to_extreme.html
>
> Anne
>
>
> On 6/27/06, Anne Thomas Manes <at...@gmail.com> wrote:
> >
> > If you have two methods, then you must have two endpoints. Otherwise, it
> > isn't RESTful.
> >
> >
> > Anne
> >
> > On 6/27/06, Anamitra.Bhattacharyya@mro.com <
> > Anamitra.Bhattacharyya@mro.com> wrote:
> > >
> > > Hi Anne
> > > I am sorry - I probably didnt get the answer.
> > > I have a service class that has 2 methods -
> > >
> > > public OMElement dothis(OMElement om1)
> > > public OMElement dothat(OMElement om2)
> > >
> > > Now for this service there will be one REST endpoint address - right?
> > > then my question is given my payload xml - how does axis decide which
> > > method to invoke in my service?
> > >
> > > I didnt quite get what u meant by
> > >
> > > "You have only one function associated with POST to a specific URL"
> > > Are u saying that my service can have only one method for it to be
> > > rest
> > > enabled?
> > > thanks
> > > Anamitra
> > >
> > >
> > >
> > >
> > >
> > >              "Anne Thomas
> > >              Manes"
> > >              < atmanes@gmail.co
> > >                                           To
> > >              m>                         axis-user@ws.apache.org
> > >                                                                         cc
> > >
> > >              06/27/2006 01:17
> > >
> > > PM                                                    Subject
> > >                                        Re: [Axis2] rest question
> > >
> > >              Please respond to
> > >              axis-user@ws.apac
> > >                    he.org
> > >
> > >
> > >
> > >
> > >
> > >
> > > When using a RESTful service, *POST* is your method. You have only one
> > >
> > > function associated with POST to a specific URL. If you have a service
> > > that
> > > exposes methods other than GET, POST, PUT, or DELETE, then it isn't
> > > RESTful.
> > >
> > > Anne
> > >
> > > On 6/27/06, Anamitra.Bhattacharyya@mro.com <
> > > Anamitra.Bhattacharyya@mro.com
> > > > wrote:
> > >
> > >   Hi
> > >   As per the axis2 doc it seems that if I want to do a POST rest
> > > service -
> > >   the only way axis runtime would detect which method to delegate the
> > > call
> > >   to
> > >   is from the name of the top level element in the http message body
> > > XML -
> > >   right?
> > >   I have a service whose method definition is like
> > >
> > >   public OMElement dothis(OMElelemt payload)
> > >
> > >   When I do the SOAP client  invoke I send the soap action as
> > > urn:dothis
> > >   and
> > >   my payload top element does not match the method name - This works
> > > fine
> > >   with axis2.
> > >
> > >   But now if I have to do REST call and not have the root element as
> > > method
> > >   name - how can I acheive that using rest? [I presume soap action is
> > > not
> > >   going to work here or is it?]
> > >
> > >   thanks
> > >   Anamitra
> > >
> > >
> > >
> > >   ---------------------------------------------------------------------
> > >   To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > >   For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
>

Re: [Axis2] rest question

Posted by Anne Thomas Manes <at...@gmail.com>.
Here's a useful guide to understanding REST:
http://prescod.net/rest/Steps_to_extreme.html

Anne

On 6/27/06, Anne Thomas Manes <at...@gmail.com> wrote:
>
> If you have two methods, then you must have two endpoints. Otherwise, it
> isn't RESTful.
>
>
> Anne
>
> On 6/27/06, Anamitra.Bhattacharyya@mro.com <An...@mro.com>
> wrote:
> >
> > Hi Anne
> > I am sorry - I probably didnt get the answer.
> > I have a service class that has 2 methods -
> >
> > public OMElement dothis(OMElement om1)
> > public OMElement dothat(OMElement om2)
> >
> > Now for this service there will be one REST endpoint address - right?
> > then my question is given my payload xml - how does axis decide which
> > method to invoke in my service?
> >
> > I didnt quite get what u meant by
> >
> > "You have only one function associated with POST to a specific URL"
> > Are u saying that my service can have only one method for it to be rest
> > enabled?
> > thanks
> > Anamitra
> >
> >
> >
> >
> >
> >              "Anne Thomas
> >              Manes"
> >              < atmanes@gmail.co
> >                                           To
> >              m>                        axis-user@ws.apache.org
> >                                                                         cc
> >
> >              06/27/2006 01:17
> >
> > PM                                                    Subject
> >                                        Re: [Axis2] rest question
> >
> >              Please respond to
> >              axis-user@ws.apac
> >                   he.org
> >
> >
> >
> >
> >
> >
> > When using a RESTful service, *POST* is your method. You have only one
> > function associated with POST to a specific URL. If you have a service
> > that
> > exposes methods other than GET, POST, PUT, or DELETE, then it isn't
> > RESTful.
> >
> > Anne
> >
> > On 6/27/06, Anamitra.Bhattacharyya@mro.com <
> > Anamitra.Bhattacharyya@mro.com
> > > wrote:
> >
> >   Hi
> >   As per the axis2 doc it seems that if I want to do a POST rest service
> > -
> >   the only way axis runtime would detect which method to delegate the
> > call
> >   to
> >   is from the name of the top level element in the http message body XML
> > -
> >   right?
> >   I have a service whose method definition is like
> >
> >   public OMElement dothis(OMElelemt payload)
> >
> >   When I do the SOAP client  invoke I send the soap action as urn:dothis
> >   and
> >   my payload top element does not match the method name - This works
> > fine
> >   with axis2.
> >
> >   But now if I have to do REST call and not have the root element as
> > method
> >   name - how can I acheive that using rest? [I presume soap action is
> > not
> >   going to work here or is it?]
> >
> >   thanks
> >   Anamitra
> >
> >
> >   ---------------------------------------------------------------------
> >   To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> >   For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>

Re: [Axis2] rest question

Posted by Anne Thomas Manes <at...@gmail.com>.
If you have two methods, then you must have two endpoints. Otherwise, it
isn't RESTful.

Anne

On 6/27/06, Anamitra.Bhattacharyya@mro.com <An...@mro.com>
wrote:
>
> Hi Anne
> I am sorry - I probably didnt get the answer.
> I have a service class that has 2 methods -
>
> public OMElement dothis(OMElement om1)
> public OMElement dothat(OMElement om2)
>
> Now for this service there will be one REST endpoint address - right?
> then my question is given my payload xml - how does axis decide which
> method to invoke in my service?
>
> I didnt quite get what u meant by
>
> "You have only one function associated with POST to a specific URL"
> Are u saying that my service can have only one method for it to be rest
> enabled?
> thanks
> Anamitra
>
>
>
>
>
>              "Anne Thomas
>              Manes"
>              <atmanes@gmail.co                                          To
>              m>                        axis-user@ws.apache.org
>                                                                         cc
>              06/27/2006 01:17
>              PM                                                    Subject
>                                        Re: [Axis2] rest question
>
>              Please respond to
>              axis-user@ws.apac
>                   he.org
>
>
>
>
>
>
> When using a RESTful service, *POST* is your method. You have only one
> function associated with POST to a specific URL. If you have a service
> that
> exposes methods other than GET, POST, PUT, or DELETE, then it isn't
> RESTful.
>
> Anne
>
> On 6/27/06, Anamitra.Bhattacharyya@mro.com <
> Anamitra.Bhattacharyya@mro.com
> > wrote:
>
>   Hi
>   As per the axis2 doc it seems that if I want to do a POST rest service -
>   the only way axis runtime would detect which method to delegate the call
>   to
>   is from the name of the top level element in the http message body XML -
>   right?
>   I have a service whose method definition is like
>
>   public OMElement dothis(OMElelemt payload)
>
>   When I do the SOAP client  invoke I send the soap action as urn:dothis
>   and
>   my payload top element does not match the method name - This works fine
>   with axis2.
>
>   But now if I have to do REST call and not have the root element as
> method
>   name - how can I acheive that using rest? [I presume soap action is not
>   going to work here or is it?]
>
>   thanks
>   Anamitra
>
>
>   ---------------------------------------------------------------------
>   To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>   For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: [Axis2] rest question

Posted by An...@mro.com.
Hi
thanks for all the replies - I will try some test and probably will be
better able to grasp REST with axis2.
thanks
Anamitra


                                                                           
             "Martin Gainty"                                               
             <mgainty@hotmail.                                             
             com>                                                       To 
                                       <ax...@ws.apache.org>           
             06/27/2006 01:51                                           cc 
             PM                                                            
                                                                   Subject 
                                       Re: [Axis2] rest question           
             Please respond to                                             
             axis-user@ws.apac                                             
                  he.org                                                   
                                                                           
                                                                           
                                                                           




You have only one function
public OMElement dothis(OMElement om1)
public OMElement dothat(OMElement om2)
are both considered the same signature therefore they are one function..

associated with POST
(IN order to be RESTful you invoke using method="POST")

to a specific URL
certainly true assuming one endpoint address


The statement is correct..

Do you perhaps have more specific questions?
Martin --
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



----- Original Message -----
From: <An...@mro.com>
To: <ax...@ws.apache.org>
Sent: Tuesday, June 27, 2006 1:43 PM
Subject: Re: [Axis2] rest question


> Hi Anne
> I am sorry - I probably didnt get the answer.
> I have a service class that has 2 methods -
>
> public OMElement dothis(OMElement om1)
> public OMElement dothat(OMElement om2)
>
> Now for this service there will be one REST endpoint address - right?
> then my question is given my payload xml - how does axis decide which
> method to invoke in my service?
>
> I didnt quite get what u meant by
>
> "You have only one function associated with POST to a specific URL"
> Are u saying that my service can have only one method for it to be rest
> enabled?
> thanks
> Anamitra
>
>
>
>
>

>             "Anne Thomas

>             Manes"

>             <atmanes@gmail.co                                          To

>             m>                        axis-user@ws.apache.org

>                                                                        cc

>             06/27/2006 01:17

>             PM                                                    Subject

>                                       Re: [Axis2] rest question

>

>             Please respond to

>             axis-user@ws.apac

>                  he.org

>

>

>
>
>
>
> When using a RESTful service, *POST* is your method. You have only one
> function associated with POST to a specific URL. If you have a service
that
> exposes methods other than GET, POST, PUT, or DELETE, then it isn't
> RESTful.
>
> Anne
>
> On 6/27/06, Anamitra.Bhattacharyya@mro.com <
Anamitra.Bhattacharyya@mro.com
>> wrote:
>
>  Hi
>  As per the axis2 doc it seems that if I want to do a POST rest service -
>  the only way axis runtime would detect which method to delegate the call
>  to
>  is from the name of the top level element in the http message body XML -
>  right?
>  I have a service whose method definition is like
>
>  public OMElement dothis(OMElelemt payload)
>
>  When I do the SOAP client  invoke I send the soap action as urn:dothis
>  and
>  my payload top element does not match the method name - This works fine
>  with axis2.
>
>  But now if I have to do REST call and not have the root element as
method
>  name - how can I acheive that using rest? [I presume soap action is not
>  going to work here or is it?]
>
>  thanks
>  Anamitra
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>  For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


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


Re: [Axis2] rest question

Posted by Martin Gainty <mg...@hotmail.com>.
You have only one function 
public OMElement dothis(OMElement om1)
public OMElement dothat(OMElement om2)
are both considered the same signature therefore they are one function..

associated with POST 
(IN order to be RESTful you invoke using method="POST")

to a specific URL
certainly true assuming one endpoint address


The statement is correct..

Do you perhaps have more specific questions?
Martin --
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



----- Original Message ----- 
From: <An...@mro.com>
To: <ax...@ws.apache.org>
Sent: Tuesday, June 27, 2006 1:43 PM
Subject: Re: [Axis2] rest question


> Hi Anne
> I am sorry - I probably didnt get the answer.
> I have a service class that has 2 methods -
> 
> public OMElement dothis(OMElement om1)
> public OMElement dothat(OMElement om2)
> 
> Now for this service there will be one REST endpoint address - right?
> then my question is given my payload xml - how does axis decide which
> method to invoke in my service?
> 
> I didnt quite get what u meant by
> 
> "You have only one function associated with POST to a specific URL"
> Are u saying that my service can have only one method for it to be rest
> enabled?
> thanks
> Anamitra
> 
> 
> 
> 
>                                                                           
>             "Anne Thomas                                                  
>             Manes"                                                        
>             <atmanes@gmail.co                                          To 
>             m>                        axis-user@ws.apache.org             
>                                                                        cc 
>             06/27/2006 01:17                                              
>             PM                                                    Subject 
>                                       Re: [Axis2] rest question           
>                                                                           
>             Please respond to                                             
>             axis-user@ws.apac                                             
>                  he.org                                                   
>                                                                           
>                                                                           
> 
> 
> 
> 
> When using a RESTful service, *POST* is your method. You have only one
> function associated with POST to a specific URL. If you have a service that
> exposes methods other than GET, POST, PUT, or DELETE, then it isn't
> RESTful.
> 
> Anne
> 
> On 6/27/06, Anamitra.Bhattacharyya@mro.com < Anamitra.Bhattacharyya@mro.com
>> wrote:
> 
>  Hi
>  As per the axis2 doc it seems that if I want to do a POST rest service -
>  the only way axis runtime would detect which method to delegate the call
>  to
>  is from the name of the top level element in the http message body XML -
>  right?
>  I have a service whose method definition is like
> 
>  public OMElement dothis(OMElelemt payload)
> 
>  When I do the SOAP client  invoke I send the soap action as urn:dothis
>  and
>  my payload top element does not match the method name - This works fine
>  with axis2.
> 
>  But now if I have to do REST call and not have the root element as method
>  name - how can I acheive that using rest? [I presume soap action is not
>  going to work here or is it?]
> 
>  thanks
>  Anamitra
> 
> 
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>  For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
>

Re: [Axis2] rest question

Posted by An...@mro.com.
Hi Anne
 I am sorry - I probably didnt get the answer.
I have a service class that has 2 methods -

public OMElement dothis(OMElement om1)
public OMElement dothat(OMElement om2)

Now for this service there will be one REST endpoint address - right?
then my question is given my payload xml - how does axis decide which
method to invoke in my service?

I didnt quite get what u meant by

"You have only one function associated with POST to a specific URL"
Are u saying that my service can have only one method for it to be rest
enabled?
thanks
Anamitra




                                                                           
             "Anne Thomas                                                  
             Manes"                                                        
             <atmanes@gmail.co                                          To 
             m>                        axis-user@ws.apache.org             
                                                                        cc 
             06/27/2006 01:17                                              
             PM                                                    Subject 
                                       Re: [Axis2] rest question           
                                                                           
             Please respond to                                             
             axis-user@ws.apac                                             
                  he.org                                                   
                                                                           
                                                                           




When using a RESTful service, *POST* is your method. You have only one
function associated with POST to a specific URL. If you have a service that
exposes methods other than GET, POST, PUT, or DELETE, then it isn't
RESTful.

Anne

On 6/27/06, Anamitra.Bhattacharyya@mro.com < Anamitra.Bhattacharyya@mro.com
> wrote:

  Hi
  As per the axis2 doc it seems that if I want to do a POST rest service -
  the only way axis runtime would detect which method to delegate the call
  to
  is from the name of the top level element in the http message body XML -
  right?
  I have a service whose method definition is like

  public OMElement dothis(OMElelemt payload)

  When I do the SOAP client  invoke I send the soap action as urn:dothis
  and
  my payload top element does not match the method name - This works fine
  with axis2.

  But now if I have to do REST call and not have the root element as method
  name - how can I acheive that using rest? [I presume soap action is not
  going to work here or is it?]

  thanks
  Anamitra


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




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


Re: [Axis2] rest question

Posted by Anne Thomas Manes <at...@gmail.com>.
When using a RESTful service, *POST* is your method. You have only one
function associated with POST to a specific URL. If you have a service that
exposes methods other than GET, POST, PUT, or DELETE, then it isn't RESTful.

Anne

On 6/27/06, Anamitra.Bhattacharyya@mro.com <An...@mro.com>
wrote:
>
>
> Hi
> As per the axis2 doc it seems that if I want to do a POST rest service -
> the only way axis runtime would detect which method to delegate the call
> to
> is from the name of the top level element in the http message body XML -
> right?
> I have a service whose method definition is like
>
> public OMElement dothis(OMElelemt payload)
>
> When I do the SOAP client  invoke I send the soap action as urn:dothis and
> my payload top element does not match the method name - This works fine
> with axis2.
>
> But now if I have to do REST call and not have the root element as method
> name - how can I acheive that using rest? [I presume soap action is not
> going to work here or is it?]
>
> thanks
> Anamitra
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>