Page 1 of 1

Issue in Soap Client

PostPosted:Mon Oct 05, 2015 1:28 pm
by rashedmohajer
hi
I using php soap Clint to test Authentication
Code: Select all
<?php
  // Register WSDL
  $OKMAuth = new SoapClient('http://localhost:8080/OpenKM/services/OKMAuth?wsdl');
 
  // Login
  $loginResp = $OKMAuth->login(array('user' => 'okmAdmin', 'password' => 'admin'));
  $token = $loginResp->return;
  echo "Token: ".$token;
 
  // Logout
  $OKMAuth->logout(array('token' => $token));
?>
But sometimes it return token and sometimes error (SoapFault)
i try google But all the solutions on the PHP server settings
and Still problem exists , i think the problem tomcat server
Is there one would like to help me with this problem
I Use the latest version of openkm community , Wamp Server Apache version 2.2.11 , php version 5.3.0 windows 7 , Mozilla Firefox 41.0.1

Re: Issue in Soap Client

PostPosted:Tue Oct 06, 2015 5:59 pm
by jllort
Why do not try to use our sdk for php ?
http://wiki.openkm.com/index.php/SDK_for_PHP

Could be several reason for this error, but if sometimes it retrieves the token and other you get and error I should looking for connection problems. Also take a look at catalina.log file ( to see complete error in case the connection really be established, otherwise you will not seeing anything there ).

Re: Issue in Soap Client

PostPosted:Thu Oct 08, 2015 2:26 pm
by rashedmohajer
Do you have any idea about this Error
Code: Select all
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost:8080/OpenKM/services/OKMAuth?wsdl' : Extra content at the end of the document in C:\wamp\www\PROJECT\OKMSDK\logintest.php:3 Stack trace: #0 C:\wamp\www\PROJECT\OKMSDK\logintest.php(3): SoapClient->SoapClient('http://localhos...') #1 {main} thrown in C:\wamp\www\PROJECT\OKMSDK\logintest.php on line 3

Re: Issue in Soap Client

PostPosted:Fri Oct 09, 2015 5:48 pm
by jllort
Try with this code, I've checked and goes right:
Code: Select all
<?php
  // Register WSDL
  $OKMAuth = new SoapClient('http://demo.openkm.com/OpenKM/services/OKMAuth?wsdl');
 
  // Login
  $loginResp = $OKMAuth->login(array('user' => 'user1', 'password' => 'pass1'));
  $token = $loginResp->return;
  echo "Token: ".$token;
 
  // Logout
  $OKMAuth->logout(array('token' => $token));
?>