06-05-2012 11:14 AM
HttpClient client = new DefaultHttpClient();
HttpGet httpget = new HttpGet("http://localhost:8080/alfresco/service/api/login?u=nuno&pw=*****");
System.out.println("executing request " + httpget.getURI());
<?xml version="1.0" encoding="UTF-8"?>
<ticket>TICKET_606b17d58d32cecfce804685b6c33509093df60a</ticket>
http://localhost:8080/alfresco/service/javadir/Company%20Home?verbose=true?alf_ticket=606b17d58d32ce...
http://localhost:8080/alfresco/service/javadir/Company%20Home?verbose=true?alf_ticket=TICKET_606b17d...
But I get:Exception in thread "main" org.apache.http.client.HttpResponseException: Unauthorized
at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:68)
at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:54)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:1070)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:1044)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:1035)
at HTTPTest.main(HTTPTest.java:61)
06-05-2012 11:32 AM
http://localhost:8080/alfresco/service/javadir/Company%20Home?verbose=true&alf_ticket=TICKET_606b17d...
Regards,06-05-2012 11:40 AM
Hi,
The correct URL is the second one since alf_ticket is always in the form TICKET_<hex sequence>
I think you missed the & into the querystring
try withRegards,http://localhost:8080/alfresco/service/javadir/Company%20Home?verbose=true&alf_ticket=TICKET_606b17d...
Andrea
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.