Hello Thierry,

thx for your help but unfortunately, I have the same error message when I
use the *ClientResource.get()* method instead of *ClientResource.handle()*.

Note: when I get content from a local server, I do not have any trouble.
This exception is thrown only when trying to get content to an "external"
server.
Note 2: the files are available and the servers work (I tested them : I can
get the files in my browser).

Thx again.


---------------------------------------------------
Cédric VIDREQUIN



2011/3/9 Thierry Boileau <[email protected]>

> Hello Cédric,
>
> using a ClientResource, you can directly use the "get" method.
>
>
> ClientResource res = new ClientResource(uri); // URI is a parameter that
> leads to an XML file on a server
> res.setRetryOnError(false);
> res.setChallengeResponse(challengeScheme, identifier, new String(secret));
> // identifier and secret are some given parameters
> res.get().write(System.out); // directly write the returned entity to the
> console
>
> If you intend to send content to the remote resource, you simply can't use
> the "GET" method aims at get a representation of the state of the target
> resource.
> You should use POST or PUT, for example:
> ClientResource res = new ClientResource(uri); // URI is a parameter that
> leads to an XML file on a server
> res.setRetryOnError(false);
> res.setChallengeResponse(challengeScheme, identifier, new String(secret));
> // identifier and secret are some given parameters
> res.post(body).write(System.out); // directly write the returned entity to
> the console
>
>
> Best regards,
> Thierry Boileau
>
>
>
> Hi all,
>>
>> I'm using an *org.restlet.resource.ClientResource* :
>>
>> /* this code is the simplified version of the code I use, so that it is
>> easier to read */
>> ClientResource res = new ClientResource(uri); // URI is a parameter that
>> leads to an XML file on a server
>> res.setRetryOnError(false);
>> res.setMethod(method); // here we do a GET method
>> res.getRequest().setEntity(body);
>> res.setChallengeResponse(challengeScheme, identifier, new String(secret));
>> // identifier and secret are some given parameters
>> rep = res.handle();
>> Status status = res.getStatus();
>>
>>
>> When I try to get the remote content, the request is sent ... but fails
>> after the time out expires.
>> *status.isError()* is true with the following status code and message :
>>
>> *Internal Connector Error (1002) - HTTP 1002 (The calling thread timed
>> out while waiting for a response to unblock it.)*
>>
>>
>>
>> I tried to get the content from two different servers but I face the same
>> exception. Does anyone have an idea of the reason of that problem ?
>>
>> Do you need more information to help me ? If so, do not hesitate to ask
>> for it.
>>
>>
>> Thanks in advance for helping.
>>
>>
>> ---------------------------------------------------
>> Cédric VIDREQUIN
>>
>>
>

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

Reply via email to