• Cannot connect to SOAP, but can open WSDL

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
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.
 #11591  by bitscorpion
 
Hi,
I'm new in OpenKM and installed the latest version.
I installed it as a system-service like it is described in the wiki. Listeningaddress is 0.0.0.0

The fascinating thing is, that I can access the WSDL files from the browser, but I can't connect with any client.

Any ideas?
 #11599  by jllort
 
Here for example is a login example with php
Code: Select all
<?php
  // Register WSDL
  $OKMAuth = new SoapClient('http://localhost:8080/OpenKM/OKMAuth?wsdl');
 
  // Login
  $token = $OKMAuth->login('okmAdmin','admin');
  echo "Token: ".$token;
 
  // Logout
  $OKMAuth->logout($token);
?>
 #11647  by bitscorpion
 
Thanks, I know, how to connect to an SOAP-Api.

The problem is, that this works only on localhost.
But I want to access the SOAP-API remotely from my private network => 192.168.12.20 and this doesn't work.
I can use the webinterface http://192.168.12.20:8080/OpenKM,
but I can't connect with SOAP to 192.168.12.20.

Ideas?
 #11878  by noxx
 
I have the same issue. Runnig the php script on localhost works fine, but running it from annother computer throws "SoapFault: Could not connect to host" and terminates on line
Code: Select all
$token = $OKMAuth->login($okmid, $okmpw);
Has anyone solved it yet?

EDIT my script
Code: Select all
<?php
function importFileInOKM($file,$okmip,$okmid,$okmpw) {
  $okmurl="http://".$okmip.":8080/OpenKM/";

  $OKMAuth = new SoapClient($okmurl."OKMAuth?wsdl");
  $OKMDocument = new SoapClient($okmurl."OKMDocument?wsdl");

  // open file
  $handle = fopen($file,'rb');
  $file_content = fread($handle,filesize($file));
  fclose($handle);

  // Login
  $token = $OKMAuth->login($okmid, $okmpw);   // THE ERROR IS THROWN HERE
  $OKMDocument->createSimple($token,"/okm:root/".$file,$file_content);

  // Logout
  $OKMAuth->logout($token);
 }
 
$file="file.pdf";
//$okmip="localhost";
$okmip="105.104.103.33";
$okmid="okmAdmin";
$okmpw="admin";

importFileInOKM($file,$okmip,$okmid,$okmpw);
 #11901  by pavila
 
This is a "feature" of JBoss WS. If you see the WSDL the methods are bounded to localhost (or 127.0.0.1) so you need to override it when you make the call. From Java it can be performed this way:
Code: Select all
bpAuth.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, host+"/OKMAuth");
You also can change this JBoss WS behabior but now I don't rememeber whith file you need to edit. Perhaps you should take a look to the JBoss forums.

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.