AuthenticationUtils.startSession(lgn, psw);- Dans mon appli, je navigue, fait des recherches et autres choses, quand parfois cela me donne une erruer comme celle ci:
WSDoAllSender: password callback failed; nested exception is:- j'ai donc cherché un peu comment faire une connexion plus propre. Sur le forum officiel, je trouve le post: http://forums.alfresco.com/viewtopic.php?t=7195&highlight=ticket qui me renvoie sur la page du wiki suivante: http://wiki.alfresco.com/wiki/Web_Service_Samples_for_Java
org.alfresco.webservice.util.WebServiceException: Ticket could not be found when calling callback handler.
// Get a reference to theCar dans ce cas je dois toujours garder quelque part le username et password pour appeler "authenticationService.startSession(userName, password);"
AuthenticationServiceSoapBindingStub authenticationService =
(AuthenticationServiceSoapBindingStub) new AuthenticationServiceLocator()
.getAuthenticationService();
// Start the session
AuthenticationResult result = authenticationService
.startSession(userName, password);
String ticket = result.getTicket();
…
// business à faire
…
// End the session
authenticationService.endSession(ticket);
AuthenticationUtils.startSession(lgn, psw);ou
AuthenticationResult result = authenticationService?
.startSession(userName, password);
String ticket = result.getTicket();
public List<ContentResult> getRankedContent(String username, String password) throws ServiceException, AuthenticationFault, RemoteException {j'ai un "Ticket could not be found when calling callback handler" au niveau de l'appel de repositorry.query(store, query, true);
List<ContentResult> results = new ArrayList<ContentResult>();
//—————————————-
AuthenticationServiceSoapBindingStub authenticationService = (AuthenticationServiceSoapBindingStub) new AuthenticationServiceLocator()
.getAuthenticationService();
AuthenticationResult result = authenticationService.startSession(
username, password);
System.out.println("result: "+ result);
//—————————————-
try {
RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory
.getRepositoryService();
// Define query
Query query = new Query(Constants.QUERY_LANG_LUCENE, "TEXT:" + this.getText());
// Execute the query with includeMetadata = true
QueryResult queryResult = repositoryService.query(store, query,
true);
System.out.println("Statement: " +query.getStatement());
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.