Hi Anne,
 
        I'm not using REST for my web services, I just gave the login sample as 
an example for zakaria's email about passing parameters to in a REST way.
 
Thanks
Raghu

________________________________

From: Anne Thomas Manes [mailto:[EMAIL PROTECTED]
Sent: Wed 7/4/2007 3:23 PM
To: axis-user@ws.apache.org
Subject: Re: Axis2 & rest



You should use GET only if your intention is to "get" a representation
of a resource -- i.e., a "safe" operation that does not effect any
change of state to the server.

If your intention is to make some type of change to the resource, you
should use one of the following non-safe methods: POST, PUT, or
DELETE.

As Vibhor says, if you want to follow REST constraints, then you
should design your resources in such a way that every *thing* that you
might want to get from the "service" has a unique URI. You should
never need to pass a complex type as input to identify the thing you
are trying to get.

Your login request is not a "safe" method. In a RESTful system, it
would create a resource that represents your session. Therefore you
should use POST rather than GET. But why are you doing a login in the
application payload? You should use the infrastructure for
authentication -- HTTP authentication, SSL authentication, or
WS-Security authentication.

Anne

On 7/4/07, Vibhor_Sharma <[EMAIL PROTECTED]> wrote:
>
>
>
> If you want to use POX(plain old xml) over HTTP using the POST mechanism
> then you could dispatch the complex data types. But that is not the pure
> form of REST.
> try to design your schema in such a way that you can invoke the requests
> using simple GET mechanism.
>
>  ________________________________
>  From: Anne Thomas Manes [mailto:[EMAIL PROTECTED]
> Sent: Tue 7/3/2007 6:03 PM
>
> To: axis-user@ws.apache.org
> Subject: Re: Axis2 & rest
>
>
> Perhaps one of the developers can answer this?
> I'd be more inclined to use straight HTTP than Axis2, though.
>
> Anne
>
>
> On 7/3/07, Raghu Upadhyayula <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> > Thanks Anne.
> >
> >
> >
> > How do you submit a request having complex types with a POST?  Can you
> show me for the login method sample with User object containing username &
> password?
> >
> >
> >
> > Thanks
> >
> > Raghu
> >
> >
> >
> > ________________________________
>
> >
> > From: Anne Thomas Manes [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, July 03, 2007 2:41 PM
> > To: axis-user@ws.apache.org
> > Subject: Re: Axis2 & rest
> >
> >
> >
> >
> > You can submit a resource representation (containing complex types) using
> PUT or POST.
> > But Jeff is correct that you cannot submit a complex query parameter via
> URL encoding.
> >
> > Also note that encoding a password as a query parameter in a URL (per
> Raghu's example) violates just about every security best practice
> imaginable.
> >
> > And this time I'll bite my tongue and not rant about the inappropriateness
> of turning a method into a resource.
> >
> > Anne
> >
> >
> > On 7/3/07, Walker, Jeff < [EMAIL PROTECTED]> wrote:
> >
> > You don't pass complex types in REST web services. Period.
> > It's all about those Query parameters, the name-value pairs following
> > the '?' and separated by the '&'.
> > REST services is all about manipulating resources, not passing complex
> > types.
> > If you want to send complex types, then you need the so-called 'big' web
> > services technologies like SOAP/WSDL.
> > -jeff
> >
> >
> > -----Original Message-----
> > From: Raghu Upadhyayula [mailto: [EMAIL PROTECTED]
> > Sent: Tuesday, July 03, 2007 3:45 PM
> > To: axis-user@ws.apache.org
> > Subject: RE: Axis2 & rest
> >
> > Hi Zakaria,
> >
> >         For the methods with simple parameters you use it like this....
> >
> >         Say I have a webservice MyService with login method and username
> > & password parameters, then the rest URL will look like this.
> >
> >
> http://localhost/axis2/services/MyService/login?username=raghu&password=
> > xxx
> >
> >         But I'm not sure how to call it if the parameter is a complex
> > type, like if my login method takes in a User object which has username
> > & password as members of the User object, then I'm not sure how to call
> > that.
> >
> >
> > Thanks
> > Raghu
> >
> > -----Original Message-----
> > From: zakaria ghandour [mailto: [EMAIL PROTECTED]
> > Sent: Tuesday, July 03, 2007 9:10 AM
> > To: axis-user@ws.apache.org
> > Subject: Re: Axis2 & rest
> >
> >
> > Hi,
> >
> > axis2/services/{service name}/{Operation name}
> >
> > can you tel me how to call ws as rest if there is parameters ??
> >
> > thanks
> > --
> > View this message in context:
> >
> http://www.nabble.com/Axis2---rest-tf4018616.html#a11414842
> > Sent from the Axis - User mailing list archive at Nabble.com.
> >
> >
> >
> ---------------------------------------------------------------------
> > 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]
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > 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]



<<winmail.dat>>

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

Reply via email to