Taking advantage of connection reuse?

2010-05-28 Thread Daniel Ferber
Hi,

I am wondering if Restlet reuses the HTTP connections for multiple requests
per client.
And if yes, how could I take advantage of that?

I consider that a client sends a burst of requests. As long as the
connections is alive, for example, I could use the same database session,
instead of creating a session for each request.

Best regards,
Daniel Felix Ferber

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

Where to find documentation regarding annotations in V2 RC3

2010-05-28 Thread webpost
Hi,

where can I find documentation how to use annotations for v2 RC3 ?

More over I have a problem how to define that a POST should get as payload a 
multipart-form (fields + file) and  I should send back a PDF document.

I understand I can define @Post(???|pdf) but I don't know what the ??? should 
be replaced with ?

Any help much appreciated...

Regards,

Hideki

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


RE: Where to find documentation regarding annotations in V2 RC3

2010-05-28 Thread Thierry Boileau
Hello Hideki,

you can find documentation on the wiki : 
http://wiki.restlet.org/developers/172-restlet/226-restlet.html

At this moment, multipart documents are not supported: 
http://restlet.tigris.org/issues/show_bug.cgi?id=71

Best regards,
Thierry Boileau

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


RE: Where to find documentation regarding annotations in V2 RC3

2010-05-28 Thread HT
Hi Thierry,

thanks a lot.

What is the annotation for a POST that gets xml in and should send pdf document 
out ?

Is is @Post(xml|pdf) ?

Is there somewhere an example of how to send back a byte stream to the 
outputstream ?

Regards,

HT.

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


V2. RC.3 : java.lang.NoSuchMethodError when POSTing xml

2010-05-28 Thread HT
Hi,

I get following error when trying to  consume an xml document passed via a 
POST. The error pops-up at following line: 

 SaxRepresentation xmldocument = new SaxRepresentation(entity);


FINE: Delegating the call to the target Restlet
28-mei-2010 20:28:59 org.restlet.service.ConverterService toObject
FINE: The following converter was selected for the [application/xml] 
representation: org.restlet.engine.converter.defaultconver...@e1ed5b
28-mei-2010 20:28:59 org.restlet.resource.UniformResource doCatch
INFO: Exception or error caught in resource
org.restlet.resource.ResourceException: 
org.restlet.representation.Representation.getLocationRef()Lorg/restlet/data/Reference;
 at org.restlet.resource.ServerResource.doHandle(ServerResource.java:410)

Caused by: java.lang.NoSuchMethodError: 
org.restlet.representation.Representation.getLocationRef()Lorg/restlet/data/Reference;
 at org.restlet.ext.xml.SaxRepresentation.init(SaxRepresentation.java:145)

Can someone help me please ?

H.

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


RE: V2. RC.3 : java.lang.NoSuchMethodError when POSTing xml

2010-05-28 Thread HT
I managed to solve the problem by copying all the *.jars I found in the V2RC3 
jar file and retry again (using Tomcat 6).

The error disappears but now I get another:

28-mei-2010 22:20:33 org.restlet.resource.UniformResource doCatch
WARNING: Exception or error caught in resource
java.lang.NoClassDefFoundError: com/sun/syndication/feed/synd/SyndFeed

I'm still missing a .jar file ?

Any help much appreciated.

H.

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


RE: V2. RC.3 : java.lang.NoSuchMethodError when POSTing xml

2010-05-28 Thread HT
Solved!

IT was a problem with too much / too many jar files.

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


Which tool to use to see request/responses ?

2010-05-28 Thread HT
Hi,

which tool can I use to see what the requests and responses are between a 
httpclient and the Tomcat server ?

Currently I have client code like:

ClientResource helloClientResource =new 
ClientResource(http://localhost:8080/...;);
...

helloClientResource.post(xmldocument).write(System.out);


How can I see the actual request that is sent to Tomcat  ?

The same for the response I get back ?

Can I do this code wise or do I need a tool for this ?

Anyone using such a tools ?

H.

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


Re: Which tool to use to see request/responses ?

2010-05-28 Thread Fabian Mandelbaum
One such tool, which is made in Java, and it's not so expensive (USD
50 or so IIRC), is Charles Web Proxy.

http://www.charlesproxy.com/

There's also the HTTPFox addon for Firefox, which is good enough if
your client side is a web browser (which is not your case, but
anyway...)

I'm sure there's other web proxies too, and some even may use network
traffic sniff tools to eavesdrop on http traffic, but for 50 USD
Charles Web Proxy does an excellent job (IMVHO, of course).


On Fri, May 28, 2010 at 6:52 PM, HT hideki.tih...@gmail.com wrote:
 Hi,

 which tool can I use to see what the requests and responses are between a 
 httpclient and the Tomcat server ?

 Currently I have client code like:

 ClientResource helloClientResource =new 
 ClientResource(http://localhost:8080/...;);
 ...

 helloClientResource.post(xmldocument).write(System.out);


 How can I see the actual request that is sent to Tomcat  ?

 The same for the response I get back ?

 Can I do this code wise or do I need a tool for this ?

 Anyone using such a tools ?

 H.

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




-- 
Fabián Mandelbaum
IS Engineer

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