0

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();
    }
}       
}
4

1 に答える 1

1

The WebServiceFactory uses

http://localhost:8080/alfresco/api

as default endpoint.You can change the endpoint by providing a file called webserviceclient.properties on the classpath under alfresco (the resource path: alfresco/webserviceclient.properties)

The properties file must offer a property called repository.location, which specifies the endpoint URL. Since you are using a bitnami Alfresco instance, it is probably running on port 80. The file should contain the following property entry:

repository.location=http://localhost:80/alfresco/api
于 2012-11-04T18:51:04.457 に答える