Hello Endrio,

as said Jérôme, the client and server connectors interpretes the HTTP 
packets in order to build high level objects => Request [1] and Response 
[2].

 From the point of view of a Restlet-based client, the Response object 
contains a representation of the requested resource (assuming the client 
has sent a GET request).
If you want to parse this XML representation, you can use either the 
DomRepresentation [3], or the SaxRepresentation [4] as follow:
SaxRepresentation saxRep = new SaxRepresentation(response.getEntity());
Then, you can use the "parse(ContentHandler)" method, which gives you 
access to the content of the XML representation.
In the case you want to send a POST request with a representation, just 
prepare it (You can use SaxRepresentation, DomRepresentation, 
FileRepresentation, StringRepresentation, etc).
Then add to the request, and let the client handle it.

 From the point of view of a Restlet-based server, the Request object 
contains the POSTed representation, that you can parse with 
SaxRepresentation, or with DomRepresentation, etc.

You can have a look at the firstSteps, firstResource and the tutorial 
for more details => http://www.restlet.org/documentation/1.1/

best regards,
Thierry Boileau
[1] 
http://www.restlet.org/documentation/1.1/api/org/restlet/data/Request.html
[2] 
http://www.restlet.org/documentation/1.1/api/org/restlet/data/Response.html
[3] 
http://www.restlet.org/documentation/1.1/api/org/restlet/resource/DomRepresentation.html
[4] 
http://www.restlet.org/documentation/1.1/api/org/restlet/resource/SaxRepresentation.html

> Endrio,
>
> What a creative email title! Not sure it usually helps to get a prompt
> answer :)
>
> To get you started, you just need the "org.restlet.jar" (if you are using
> Restlet 1.2 M1), otherwise you also need "com.noelios.restlet.jar".
>
> With those two JARs in your classpath, you have built-in/internal HTTP
> server and client connectors that will handle all the HTTP communication for
> you. No need to install Tomcat to get you started, unless you have other
> constraints.
>
> For more details, see this page:
>
> "User Guide: Connectors"
> http://wiki.restlet.org/docs_1.2/13-restlet/27-restlet/37-restlet.html
>  
> Best regards,
> Jerome Louvel
> --
> Restlet ~ Founder and Lead developer ~ http://www.restlet.org
> Noelios Technologies ~ Co-founder ~ http://www.noelios.com
>
>
> -----Message d'origine-----
> De : endrio [mailto:[email protected]] 
> Envoyé : mardi 17 mars 2009 12:31
> À : [email protected]
> Objet : Help!!!!! Restlet ?!?!?!?!?
>
> Hi we're 3 italian students and we have to plan a restful architecture using
> RESTLET.
>
> We ask help to you becouse you're the developer of RESTLET.
> If you are not, we ask to you a e-mail contact of the developer if you know
> it.
>
> The architecture have to implement a B2B message exchange in xml format
> powered by GS1 XML.
>
> -Our problem is to understand how makes the client thet have to get or post
> a resource  to know resource's location and therefore the final url to use
> in the GET or POST HTTP messages  to refer to the correct locations.
>
> -HTTP packets interpretation, is powered by HTTP server created as in the
> examples  in the RESTLET's site, or we need of a server side application
> running on a http server  like Apache Tomcat? Or the server receives the
> packets only and we have to process  this packets via java code or with
> RESTLET library?
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=13402
> 39
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1341063
>
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1341291

Reply via email to