AnsweredAssumed Answered

connect to an Alfresco webservice [solved]

Question asked by thierensbart on Oct 7, 2009
Latest reply on Oct 8, 2009 by joaotpd
Hi,

it's my first time messing around with the Alfresco SDK and API.

I tried executing the FirstWebServiceClient after modifying the webserviceclient.properties file.

But when executing the first line of the code AuthenticationUtils.startSession("admin", "admin");,
all I get is:
Exception in thread "main" org.alfresco.webservice.util.WebServiceException: Error starting session.
   at org.alfresco.webservice.util.AuthenticationUtils.startSession(AuthenticationUtils.java:94)
   at org.alfresco.sample.webservice.Categories.main(Categories.java:54)
Caused by: java.net.SocketException: Connection reset
   at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
   at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
   at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
   at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
   at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
   at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
   at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
   at org.apache.axis.client.Call.invoke(Call.java:2767)
   at org.apache.axis.client.Call.invoke(Call.java:2443)
   at org.apache.axis.client.Call.invoke(Call.java:2366)
   at org.apache.axis.client.Call.invoke(Call.java:1812)
   at org.alfresco.webservice.authentication.AuthenticationServiceSoapBindingStub.startSession(AuthenticationServiceSoapBindingStub.java:187)
   at org.alfresco.webservice.util.AuthenticationUtils.startSession(AuthenticationUtils.java:79)
   … 1 more
Caused by: java.net.SocketException: Connection reset
   at java.net.SocketInputStream.read(Unknown Source)
   at java.io.BufferedInputStream.fill(Unknown Source)
   at java.io.BufferedInputStream.read(Unknown Source)
   at org.apache.axis.transport.http.HTTPSender.readHeadersFromSocket(HTTPSender.java:583)
   at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:143)
   … 12 more

My webserviceclient.properties contains repository.location=http://192.168.10.238:8081/alfresco/api which is the correct url.
When I copy-paste it in my browser I get the standard message:
[size=200]Axis HTTP Servlet[/size]
Hi, you have reached the AXIS HTTP Servlet. Normally you would be hitting this URL with a SOAP client rather than a browser.

In case you are interested, my AXIS transport name appears to be 'http'

So what might be wrong that the code crashes while starting the session…?

Outcomes