Hi all, I have a problem using cws services when I try to retrieve the session expiration date.
I am using the CWS API 16.0; the method authenticateUser returns the token correctly and if I use it to create the stub of the DocumentManagement I can create,update or delete document nodes.
Now I want manage the expiration of the session and I have to retrieve the expiration date; if I add the instruction to retrieve this value, I receive the Soap Fault reported below.
private Authentication authClient;
public CSAuthenticationManager() throws AuthenticationException {
try {
// Create the Authentication service client
String endPointAuthentication = ConfigReader.getProperty(GlobalConstants.CS_ENDPOINT_AUTHENTICATION);
Authentication_Service authService = new Authentication_Service(new java.net.URL(endPointAuthentication));
authClient = authService.getBasicHttpBindingAuthentication();
} catch(MalformedURLException ue) {
log.error("Url del ContentServer di Autenticazione Malformata " +ue.getMessage(),ue);
throw new AuthenticationException("Impossibile procedere all'autenticazione sul Content Server. URL adoperata per l'autenticazione mal formata ");
} catch (PropertyNotFoundException pe) {
log.error(pe.getMessage(),pe);
throw new AuthenticationException("Impossibile procedere all'autenticazione sul Content Server: " + pe.getMessage());
}
}
/**
* metodo adoperato per autenticarsi sul ContentServer
* @return
* @throws AuthenticationException
*/
public String authenticate() throws AuthenticationException {
String tokenCS;
try {
String[] contentServer_Authentication = ConfigReader.getProperty(GlobalConstants.CONTENT_SERVER_AUTHENTICATION).split("#");
String userName = contentServer_Authentication[0];
String password = contentServer_Authentication[1];
// Call the AuthenticateUser() method to get an authentication token
log.info("************************ Autenticazione Utente sul ContentServer ...");
tokenCS = authClient.authenticateUser(userName, password);
Date expireSessionDate = authClient.getSessionExpirationDate().toGregorianCalendar().getTime();
log.info("********** Autenticazione avvenuta con successo. Data di scadenza della sessione: " + expireSessionDate + " ***********************");
com.sun.xml.ws.fault.ServerSOAPFaultException: Client received SOAP Fault from server: Il nome utente e la password OTDS sono obbligatori. Please see the server log to find more detail regarding exact cause of the failure.
at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:193)
at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:131)
at com.sun.xml.ws.client.sei.StubHandler.readResponse(StubHandler.java:253)
at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:203)
at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:290)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:92)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:161)
at com.sun.proxy.$Proxy43.getSessionExpirationDate(Unknown Source)
at it.indra.fatturazione.elettronica.service.cs.CSAuthenticationManager.authenticate(CSAuthenticationManager.java:60)
at it.indra.fatturazione.elettronica.service.cs.CallContentServerWebService.<init>(CallContentServerWebService.java:54)
at it.indra.fatturazione.elettronica.service.cs.CS4SAPManager.<init>(CS4SAPManager.java:39)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at it.indra.fatturazione.elettronica.service.impl.NotificaFatturaElettronicaManager.executeNotificaFattura(NotificaFatturaElettronicaManager.java:124)
at it.indra.fatturazione.elettronica.manageXml.business.ProvaChiamataXml.main(ProvaChiamataXml.java:31)
Do you have any suggestions or explantions about this problem? In my system we have also the OTDS configured properly in CS.