Alfresco SDK代码挂在AuthenticationUtils.startSession上
我正在测试SDK中的代码,以便在bitNami Alresco 4.0.e-0服务器上使用与Alfresco位于同一tomcat服务器上的webapp调用Alfresco。代码在第一次调用AuthenticationUtils以获取会话时挂起。我很确定我为此提供了标准的bitNami Alfresco用户和密码。我错过图书馆了吗?我把大多数可用的依赖项放在本地maven存储库中,代码编译得很好 以下代码来自未获得Alfresco许可证的SDK,因为我无法使用它格式化代码:Alfresco SDK代码挂在AuthenticationUtils.startSession上,sdk,alfresco,bitnami,Sdk,Alfresco,Bitnami,我正在测试SDK中的代码,以便在bitNami Alresco 4.0.e-0服务器上使用与Alfresco位于同一tomcat服务器上的webapp调用Alfresco。代码在第一次调用AuthenticationUtils以获取会话时挂起。我很确定我为此提供了标准的bitNami Alfresco用户和密码。我错过图书馆了吗?我把大多数可用的依赖项放在本地maven存储库中,代码编译得很好 以下代码来自未获得Alfresco许可证的SDK,因为我无法使用它格式化代码: package org
package org.alfresco.sample.webservice;
import org.alfresco.webservice.repository.RepositoryServiceSoapBindingStub;
import org.alfresco.webservice.types.Store;
import org.alfresco.webservice.util.AuthenticationUtils;
import org.alfresco.webservice.util.WebServiceFactory;
public class GetStores extends SamplesBase
{
/**
* Connect to the respository and print out the names of the available
*
* @param args
*/
public static void main(String[] args)
throws Exception
{
// Start the session
AuthenticationUtils.startSession(USERNAME, PASSWORD);
try
{
// Get the respoitory service
RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();
// Get array of stores available in the repository
Store[] stores = repositoryService.getStores();
if (stores == null)
{
// NOTE: empty array are returned as a null object, this is a issue with the generated web service code.
System.out.println("There are no stores avilable in the repository.");
}
else
{
// Output the names of all the stores available in the repository
System.out.println("The following stores are available in the repository:");
for (Store store : stores)
{
System.out.println(store.getScheme() + "://" + store.getAddress());
}
}
}
finally
{
// End the session
AuthenticationUtils.endSession();
}
}
}
WebServiceFactory使用
http://localhost:8080/alfresco/api
作为默认端点。您可以通过在类路径的alfresco下提供名为webserviceclient.properties的文件来更改端点(资源路径:alfresco/webserviceclient.properties)
属性文件必须提供名为repository.location的属性,该属性指定端点URL。由于您使用的是bitnami Alfresco实例,因此它可能正在端口80上运行。文件应包含以下属性条目:
repository.location=http://localhost:80/alfresco/api
谢谢我找不到该文件,但在另一个名为repository.properties的文件中,我看到了该设置,并在代码中使用了它。另外,在catalina-daemon.out中,我发现调用缺少一些库。加上他们,我现在很好。谢谢