AnsweredAssumed Answered

startSession() error: (401)Unauthorized

Question asked by lurch on Jan 30, 2007
Latest reply on Jan 30, 2007 by lurch

I've recently started experimenting using AlFresco, and am trying to create a session using the web-service-client.jar from the SDK. I read the wiki and scanned some of the forums, but can't seem to find what the problem is with my code:

import org.alfresco.webservice.util.AuthenticationUtils;

public class TestSDK {
  public static void main(String[] args) {
    try {
       AuthenticationUtils.startSession("admin", "admin");
       String ticket = AuthenticationUtils.getCurrentTicket();
     } catch (Exception e) {
     } finally {

This code compiled fine, but when run, I get the folowing exception:

org.alfresco.webservice.util.WebServiceException: Error starting session.
        at org.alfresco.webservice.util.AuthenticationUtils.startSession(
        at TestSDK.main(
Caused by: (401)Unauthorized
        at org.apache.axis.transport.http.HTTPSender.readFromSocket(
        at org.apache.axis.transport.http.HTTPSender.invoke(
        at org.apache.axis.strategies.InvocationStrategy.visit(
        at org.apache.axis.SimpleChain.doVisiting(
        at org.apache.axis.SimpleChain.invoke(
        at org.apache.axis.client.AxisClient.invoke(
        at org.apache.axis.client.Call.invokeEngine(
        at org.apache.axis.client.Call.invoke(
        at org.apache.axis.client.Call.invoke(
        at org.apache.axis.client.Call.invoke(
        at org.apache.axis.client.Call.invoke(
        at org.alfresco.webservice.authentication.AuthenticationServiceSoapBindingStub.startSession(
        at org.alfresco.webservice.util.AuthenticationUtils.startSession(
        … 1 more

The server is running on port 8080 on the same host as the code is run from. Can someone please point me in the right direction

Thanks in advance