AnsweredAssumed Answered

ntlm, webservices: error processing the wsse:Security header

Question asked by ruben on Nov 14, 2012
Hey everybody,

I'm trying to devellop an application who connects to alfresco, everything worked great but now i'm trying to implement ntlm and passthru authentication.
I managed to set up  passthru and ntlm fine for using the alfresco explorer and share but when trying to connect using webservices i get an error: Error: An error was discovered processing the <wsse:Security> header. I've tried connecting to those webservices trough the cmis workbench aswell and get the same error. It happens when trying to load the repository. Also when i just supply a username and password it works aswell it's only when trying to connect with ntlm that the error occurs.

This is how i connect in java using opencmis:
Map<String, String> parameter = new HashMap<String, String>();
parameter.put(SessionParameter.BINDING_TYPE, BindingType.WEBSERVICES.value());
parameter.put(SessionParameter.WEBSERVICES_ACL_SERVICE, "ACLService=http://10.240.2.146:8080/alfresco/cmis/ACLService?wsdl");
parameter.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, "http://10.240.2.146:8080/alfresco/cmis/DiscoveryService?wsdl");
parameter.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, "http://10.240.2.146:8080/alfresco/cmis/MultiFilingService?wsdl");
parameter.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, "http://10.240.2.146:8080/alfresco/cmis/NavigationService?wsdl");
parameter.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, "http://10.240.2.146:8080/alfresco/cmis/ObjectService?wsdl");
parameter.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, "http://10.240.2.146:8080/alfresco/cmis/PolicyService?wsdl");
parameter.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, "http://10.240.2.146:8080/alfresco/cmis/RelationshipService?wsdl");
parameter.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, "http://10.240.2.146:8080/alfresco/cmis/RepositoryService?wsdl");
parameter.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, "http://10.240.2.146:8080/alfresco/cmis/VersioningService?wsdl");
parameter.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS, "org.apache.chemistry.opencmis.client.bindings.spi.NTLMAuthenticationProvider");
SessionFactory factory = SessionFactoryImpl.newInstance();
List<Repository> repositories = factory.getRepositories(parameter);
Session session = repositories.get(0).createSession;

These are my connection properties using the cmis workbench:
org.apache.chemistry.opencmis.binding.spi.type=webservices
org.apache.chemistry.opencmis.binding.webservices.RepositoryService=http://10.240.2.146:8080/alfresco/cmis/RepositoryService?wsdl
org.apache.chemistry.opencmis.binding.webservices.NavigationService=http://10.240.2.146:8080/alfresco/cmis/NavigationService?wsdl
org.apache.chemistry.opencmis.binding.webservices.ObjectService=http://10.240.2.146:8080/alfresco/cmis/ObjectService?wsdl
org.apache.chemistry.opencmis.binding.webservices.VersioningService=http://10.240.2.146:8080/alfresco/cmis/VersioningService?wsdl
org.apache.chemistry.opencmis.binding.webservices.DiscoveryService=http://10.240.2.146:8080/alfresco/cmis/DiscoveryService?wsdl
org.apache.chemistry.opencmis.binding.webservices.MultiFilingService=http://10.240.2.146:8080/alfresco/cmis/MultiFilingService?wsdl
org.apache.chemistry.opencmis.binding.webservices.RelationshipService=http://10.240.2.146:8080/alfresco/cmis/RelationshipService?wsdl
org.apache.chemistry.opencmis.binding.webservices.ACLService=http://10.240.2.146:8080/alfresco/cmis/ACLService?wsdl
org.apache.chemistry.opencmis.binding.webservices.PolicyService=http://10.240.2.146:8080/alfresco/cmis/PolicyService?wsdl
org.apache.chemistry.opencmis.binding.auth.classname=org.apache.chemistry.opencmis.client.bindings.spi.NTLMAuthenticationProvider
cmis.workbench.folder.filter=*


This is the actual error:
javax.xml.ws.soap.SOAPFaultException: An error was discovered processing the <wsse:Security> header
   com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:189)
   com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:122)
   com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)
   com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
   com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)
   $Proxy60.getRepositories(Unknown Source)
   org.apache.chemistry.opencmis.client.bindings.spi.webservices.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:62)
   org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:85)
   org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:111)
   org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:98)
   dao.TreeItemDao.<init>(TreeItemDao.java:91)
   be.ocmw_roeselare.alfresco_explorer.UploadFileController.<init>(UploadFileController.java:22)
   sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
   sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
   java.lang.reflect.Constructor.newInstance(Unknown Source)
   org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
   org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:74)
   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:958)
   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
   org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
   org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
   org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
   org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1075)
   org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:383)
   org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129)
   org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:104)
   org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
   org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:72)
   org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
   org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:109)
   org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:88)
   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1413)
   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
   org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
   org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
   org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
   org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
   org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
   org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
   org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:467)
   org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:483)
   org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:358)
   org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:325)
   org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
   javax.servlet.GenericServlet.init(GenericServlet.java:160)
   org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
   org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
   org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
   org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
   org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
   java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   java.lang.Thread.run(Unknown Source)

Outcomes