Issue in Soap Client

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.
Post Reply
rashedmohajer
Junior Boarder
Junior Boarder
Posts: 22
Joined: Sat Jul 25, 2015 8:03 am
Location: sudan

Issue in Soap Client

Post by rashedmohajer » Mon Oct 05, 2015 1:28 pm

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

jllort
Moderator
Moderator
Posts: 9642
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Issue in Soap Client

Post by jllort » Tue Oct 06, 2015 5:59 pm

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 ).

rashedmohajer
Junior Boarder
Junior Boarder
Posts: 22
Joined: Sat Jul 25, 2015 8:03 am
Location: sudan

Re: Issue in Soap Client

Post by rashedmohajer » Thu Oct 08, 2015 2:26 pm

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

jllort
Moderator
Moderator
Posts: 9642
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Issue in Soap Client

Post by jllort » Fri Oct 09, 2015 5:48 pm

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));
?>

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests