Re: Few questions about REST

Hello Mark,

Thanks for the comments,

> > Ok, as far as a (generic) intermediary is concerned, how the response
could
> > be usefully handled before it's passed to an immediate requestor ?
</snip>
> Sorry, I don't understand what you're getting at, or asking there.
I'm asking what difference does it make to an intermediary that some
document was *expected*  (echoDocument example) or *not expected*
(clarification request in SOAP primer) to be returned in reply to a POSTed
request ?
Your answer was that in a latter case an intermediary would not be confused.
If so, then what can it do with such (clarification) data that it can't do
with a document echoed back ?
As you explained, there's no the documented expectation that POST will echo
a document back. I just don't understand why is it a problem for an
intermediary.

> > code  early-binds a client. What is a programmimg model for accessing
> > late-bound services ?
>
> Well, just look at your favourite languages' HTTP libs.
Sorry, I was unclear, I was more concerned about code generation. With
early-bound services, one just takes WSDL and generates the code (proxies)
and that's it.
With late-bound services, how far the code generation can get ? One can use
WSDL support for HTTP GET/POST. For ex, a late-bound SOAP service would
accept :

GET soapgateway;stockquote:sunw
or
POST soapgateway;buystock:sunw
some data

Is it correct ?

> > POST soapgateway;stockquote:sunw
>
> How so?  Where's the documented expectation that POST will retrieve a
> quote?
Yes, you're right. In a perfectly RESTful environment one would use GET.
But I think you pointed out in an earlier mail that is not unRESTful to use
POST instead of GET (sorry, I can't find in www-archive, so here's an
extract):

>Strictly, the REST uniform interface constraint only requires that the
>interface semantics be uniform.  It doesn't require that you don't do
>the equivalent of GET via POST.  Moreover, I don't believe any of REST's
>other constraints disallow it.
What am I missing here ?

I guess one reason for using POST to get quotes from a late-bound doc style
SOAP service would be to be able to pass headers.

Thanks, Sergey







----- Original Message -----
From: "Mark Baker" <distobj@acm.org>
To: "Siarhei Biarozkin" <sberyozkin@zandar.com>
Cc: <www-archive@w3.org>
Sent: Tuesday, September 23, 2003 3:39 AM
Subject: Re: Few questions about REST


> On Fri, Sep 19, 2003 at 04:56:43AM -0400, Siarhei Biarozkin wrote:
> > > > How POST in this example can be used RESTfully to
> > > > see what happens after the data has been submitted ?
> >
> > > Well, you just POST the data, and see what you get back.  If it's a
201,
> > > then you know a new resource was created in response to your POSTed
> > > data, and you can invoke GET on that.  The POST response might also
just
> > > contain a link someplace else, which you can invoke GET on.
> > Ok, as far as a (generic) intermediary is concerned, how the response
could
> > be usefully handled before it's passed to an immediate requestor ?
> > Probably, if it's 201, then a newly created resource could be fetched in
> > advance so that it's already available by the time a request from an
> > (original) client arrives, and this also would require that intermediary
> > sets an URI of a newly created resource to its own one ?
> > What if it's not 201, but some data, as in a response from a primer,
where
> > clarification request is returned after processing an initial booking
> > request ? An intermediary can not predict that a clarification request
will
> > be or won't be returned in a POST response ; if it's returned, then how
it
> > can be generically processed?
>
> Sorry, I don't understand what you're getting at, or asking there.
>
> > I'd like also to ask about late-binding and a tool support. With WSDL
R085,
> > a tool can generate a set of classes for a client. It seems that
> > late-binding assumes that no code generation is needed, because a
generated
> > code  early-binds a client. What is a programmimg model for accessing
> > late-bound services ?
>
> Well, just look at your favourite languages' HTTP libs.
>
> > If a client wants to get a quote from a late-bound, SOAP-based service ,
it
> > could ask for it like this :
> > POST soapgateway;stockquote:sunw
>
> How so?  Where's the documented expectation that POST will retrieve a
> quote?
>
> > and from another non-SOAP service like this :
> > GET quotes/sunw,
> > using the same code, perhaps normalizing response data into a common
format.
> > So a question is : can a code be generated for a client so that it could
> > transparently talk to multiple services ?
>
> Sorry, not following again... what would you want this code to do?
> Handle the different data formats?  Sure, that could be done.
>
> Mark.
> --
> Mark Baker.   Ottawa, Ontario, CANADA.        http://www.markbaker.ca
>
>

Received on Tuesday, 23 September 2003 08:21:38 UTC