SDKのコードをテストして、Alfrescoと同じTomcatサーバーにあるWebアプリを使用してbitNamiAlresco4.0.e-0サーバーでAlfrescoを呼び出しています。セッションを取得するためのAuthenticationUtilsの最初の呼び出しで、コードがハングします。私はこれのために標準のbitNamiAlfrescoユーザーとパスワードを提供したと確信しています。ライブラリが恋しいですか?ローカルのMavenリポジトリとコードが適切にコンパイルされるため、利用可能なほとんどの依存関係を配置します。
以下は、AlfrescoライセンスなしのSDKのコードです。これを使用してコードをフォーマットできなかったため、次のようになります。
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();
}
}
}