• OpenKM 6.4.15 Web Services Error

  • Do you want to create a native client or integrate with third party applications: webservices are the solution.
Do you want to create a native client or integrate with third party applications: webservices are the solution.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #29728  by pldemon
 
Hi OpenKM team,

We are wondering if there are some code changes in the newest version that breaks the OpenKM SOAP structure. During our tests we have found that the old SOAP code we have used which OpenKM 6.4.14 is not working any more in the new version. Please find attached a small Perl script which can be used for token generation in OpenKM:
Code: Select all
#!/usr/bin/perl -w
use SOAP::Lite +trace =>  'debug';

my ($url, $user, $pass) = ("http://demo.openkm.com/OpenKM/services/OKMAuth?wsdl", "user4", "pass4");

my $soap = SOAP::Lite
	->uri('http://ws.openkm.com')
	->proxy($url);

my $token = $soap->login (
	SOAP::Data->name('{}user' => $user),
	SOAP::Data->name('{}password' => $pass))->result;

print("TOKEN :: $token\n");
If we try this script in the version prior OpenKM 6.4.15 we don't see any problems. The same script in OpenKM 6.4.15 (Trial/Online Demo) is generating an error:

Working 6.4.14:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><login xmlns="http://ws.openkm.com"><user xmlns="" xsi:type="xsd:string">myuser</user><password xmlns="" xsi:type="xsd:string">mypass</password></login></soap:Body></soap:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK

Connection: close
Server: Apache-Coyote/1.1
Client-Peer: 127.0.0.1:8080
Client-Response-Num: 1

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:loginResponse xmlns:ns2="http://ws.openkm.com"><return>00dca280-cea6-4629-bec2-4eb2d8abdd30</return></ns2:loginResponse></soap:Body></soap:Envelope>
Internal Server Error 6.4.15
Code: Select all
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><login xmlns="http://ws.openkm.com"><user xmlns="" xsi:type="xsd:string">user4</user><password xmlns="" xsi:type="xsd:string">pass4</password></login></soap:Body></soap:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error

Connection: close
Server: Apache-Coyote/1.1
Client-Peer: 127.0.0.1:8080
Client-Response-Num: 1

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>The given SOAPAction http://ws.openkm.com#login does not match an operation.</faultstring></soap:Fault></soap:Body></soap:Envelope>
Server output 6.4.15
Code: Select all
 [http-bio-0.0.0.0-8080-exec-1] WARN  org.apache.cxf.phase.PhaseInterceptorChain - Interceptor for {http://ws.openkm.com}OKMAuth#{http://ws.openkm.com}login has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: The given SOAPAction http://ws.openkm.com#login does not match an operation.
        at org.apache.cxf.binding.soap.interceptor.SoapActionInInterceptor$SoapActionInAttemptTwoInterceptor.handleMessage(SoapActionInInterceptor.java:188)
        at org.apache.cxf.binding.soap.interceptor.SoapActionInInterceptor$SoapActionInAttemptTwoInterceptor.handleMessage(SoapActionInInterceptor.java:162)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
        at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:240)
        at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:239)
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:213)
        at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:131)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:266)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:186)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:242)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)
Do we have to change the code or is this a known issue in the new version and we should stay with OpenKM 6.4.14?

Thanks,
Alfred
 #29745  by jllort
 
Can you take a look at catalina.log if there's some error deploying WS ? or something similar ?
 #29747  by pavila
 
The problem seems related to an upgrade of the Apache CXF library from 2.5.1 to 2.6.14. We're looking for a solution.
 #29748  by pavila
 
Try with:
Code: Select all
#!/usr/bin/perl -w
use SOAP::Lite +trace => 'debug';

my ($url, $user, $pass) = ("http://localhost:8080/OpenKM/services/OKMAuth?wsdl", "okmAdmin", "admin");

my $soap = SOAP::Lite
   ->uri('http://ws.openkm.com')
   ->on_action( sub { "" })
   ->proxy($url);


my $token = $soap->login (
   SOAP::Data->name('{}user' => $user),
   SOAP::Data->name('{}password' => $pass))->result;

print("TOKEN :: $token\n");
 #29790  by pavila
 
Yes, I've see the headers sent by the PHP client and there is no action, and it works. Not sure why is so different.
 #30977  by Kahanho1
 
Hey jllort, thank you for the extensive explanation. I will try to solve it with the session and reuse the authentication. Multitenancy is a okm professional feature, right? That is really interesting.

What do you think about that idea. The main instance loads repository-parts that match the role "testproject_x" from the other instances over webservices (f.e. like the joomla explorer). Maybe scripts could check every single instance automatically.

The single projects would be aggregated under "Taxonomy" or "My Documents". Is this technically possible?

Best regards
 #31017  by jllort
 
I need more clear explanations, some more detailed example will be appreciated because I'm not sure about what you try to explain us.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.