AnsweredAssumed Answered

Using web service with  'Error starting session' exception

Question asked by fantastic340 on Sep 23, 2014
Latest reply on Sep 30, 2014 by fantastic340
Hi every one,
When I was using web service API in order to create a link for node,
my part of code as follows:


                        CMLCreate create = new CMLCreate();
                        create.setParent(destinationFolder);
                        create.setAssociationType(Constants.ASSOC_CONTAINS);
                        if (isFolder) {
                                //it`s a link of folder type
                                create.setType("{http://www.alfresco.org/model/application/1.0}folderlink");
                        }else{
                                create.setType("{http://www.alfresco.org/model/application/1.0}filelink");
                        }
                        create.setProperty(prop);
                        create.setChildName("Childname");

                        CML cml = new CML();
                        cml.setCreate(new CMLCreate[] { create });

                        WebServiceFactory.setEndpointAddress("http://140.92.25.160:80/alfresco/api");
         AuthenticationUtils.startSession("admin","admin");
                        RepositoryServiceSoapBindingStub repositoryServiceSoapBindingStub =
                                        WebServiceFactory.getRepositoryService();
                        result = repositoryServiceSoapBindingStub.update(cml);
                
                        if(result.length > 0 ){
                                isSuccess = true;
                        }
                        AuthenticationUtils.endSession();

                }


And it will show error as below:


org.alfresco.webservice.util.WebServiceException: Error starting session.
        at org.alfresco.webservice.util.AuthenticationUtils.startSession(AuthenticationUtils.java:88)
        at tw.org.iii.cosa.javabacked.webscript.SoftLinkCreator.wsCreateLink(SoftLinkCreator.java:223)
        at tw.org.iii.cosa.javabacked.webscript.SoftLinkCreator.executeImpl(SoftLinkCreator.java:95)
        at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:64)




Could anyone can help me? thanks in advance.
My alfresco version is 3.4.5 and using alfresco-web-service-client-3.4.5.jar,axis-1.3.jar by the way.

Outcomes