cancel
Showing results for 
Search instead for 
Did you mean: 

Aiming to another server produces login erros(SOLVED)

sidi
Champ in-the-making
Champ in-the-making
Hi to community.
I've develop few java programs in Eclipse to bring to Alfresco 700.000 documents using web-services, probably best method will be using FTP, but that program is going to be used to keep loading documents later in slower rate.
The thing is that testing the program in localhost goes wonderfull. But when I change the webserviceclient.properties pointing to the production server and change de user and pasword, when calling CML methods guives login erros. Having a look to the cml string parameters I observe that destination is still "localhost", so I´m wondering if its necesary to do something else than just change de webserviceclient.prop.
Any idea?
Best Regards.
2 REPLIES 2

jos_snellings
Champ in-the-making
Champ in-the-making
Maybe the web service classes are looking for a .properties file in another location.

Generally it is best to get rid of this configuration file alltogether. Below you find the leading lines of code for a class that
holds a session onto an alfresco server. It has got a constructor with a dedicated url that may be read elsewhere in a config file.
If you call the 'setEndpointAccess' before anything else (it is a static method), you will be able to connect to whatever server that is
around:

private RepositoryServiceSoapBindingStub repositoryService;   

private String username;
private String password;
private String serverUrl;


public RepositoryBrowser(String AlfrescoServerUrl)
{
   this.alfrescoUrl = AlfrescoServerUrl;
   WebServiceFactory.setEndpointAddress(alfrescoUrl);
}

public void setServerUrl(String AlfrescoServerUrl)
{
   alfrescoUrl = AlfrescoServerUrl;
   WebServiceFactory.setEndpointAddress(alfrescoUrl);
}

Hope this helps.

sidi
Champ in-the-making
Champ in-the-making
thanks joss, it was the first apointment you wrote. Looking in the source code of Webservicefactory I put it in te relative path that class uses to search for de .prop file.