Dear list,

I found the solution to my question. Maybe it was obvious, but not for me so 
I'll post it here.

The trick is to avoid using ClientResource.create() in favour of the combo 
ClientResource() and ClientResource.wrap().

In my case:

DevTechnologyResource testTechnologyResource = 
ClientResource.create("http://"+host+":"+port+"/de​vice/technology/"+te​chnology,
 DevTechnologyResource.class);
output.append(testTe​chnologyResource.get​XML().getText());

rewritten to handle basic http authentication becomes:

ClientResource testclientTechnologyResource = new 
ClientResource(("http://"+host+":"+port+"/de​vice/technology/"+te​chnology);
DevTechnologyResource testTechnologyResource =  
testclientTechnologyResource.wrap(DevTechnologyResource.class);
ChallengeScheme scheme = ChallengeScheme.HTTP_BASIC;
ChallengeResponse authentication = new ChallengeResponse(scheme, "user", 
"passwd");
testclientTechnologyResource.setChallengeResponse(authentication);

Best regards,
setenv

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

Reply via email to