cancel
Showing results for 
Search instead for 
Did you mean: 

Specify the target Alfresco Server

pitonyak
Champ in-the-making
Champ in-the-making
I have a standalone Java application that connects to a local instance of Alfresco. How can I connect to an instance at a different location. For example, consider the simple code:
String userID = "admin";
    String password = "admin";
    try
    {
      AuthenticationUtils.startSession(userID, password);
      // Get the content and authoring service
      RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();
      for (Store aStore : repositoryService.getStores())
      {
        System.out.println("[Store Address: " + aStore.getAddress() + "][Store Scheme: " + aStore.getScheme() + "]");
      }
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
    }
    finally
    {
      AuthenticationUtils.endSession();
    }
The code connects to localhost. What if I want to connect to 10.5.0.2 rather than localhost?
2 REPLIES 2

mrogers
Star Contributor
Star Contributor
The WebServiceFactory has a setEndpointAddress() method that looks like it will allow you to specify another endpoint.

pitonyak
Champ in-the-making
Champ in-the-making
Excellent, I will give that a try.