Difference between revisions of "User talk:Svaitsis.gss"

From OpenKM Documentation
Jump to: navigation, search
Line 2: Line 2:
 
<b>Michael Mountrakis</b><i> Solutions Architect @UIT.GR</i>
 
<b>Michael Mountrakis</b><i> Solutions Architect @UIT.GR</i>
  
Here is an example of a simple MSDOS batch file that generates the jar to support the OpenKM Java Client like the one given in
+
 
 +
The first part describes how we can compile the WSDL from our OpenKM installation using the <b>wsimport</b> utility that comes with JDK1.6 and above. The produced client library JAR file is then imported in the Eclipse IDE in order to assist our development.
 +
 +
The example starts with a simple MSDOS batch file that generates the client library JAR to support the OpenKM Java Client like the one given in
 
the official Wiki Web Services page  
 
the official Wiki Web Services page  
  
 
http://wiki.openkm.com/index.php/Java_client
 
http://wiki.openkm.com/index.php/Java_client
  
 +
The <b>create_okm_client.bat</b> is the following one:
 
<pre>
 
<pre>
 
rem set your javahome and your openKM host
 
rem set your javahome and your openKM host
Line 33: Line 37:
 
</pre>
 
</pre>
  
 +
We run the program as a command line in the MS DOS prompt. Uppon successful completion, the file <b>okm-ws-client.jar</b> will be produced.
  
Next step is to add the okm-ws-client.jar to your Eclipse project:
+
Next step is to add the <b>okm-ws-client.jar</b> to your Eclipse project:
  
 
[[File:eclipse.png]]
 
[[File:eclipse.png]]

Revision as of 21:52, 12 February 2011

Implementing a Java Client Web Service to consume OpenKM W/S Using Eclipse

Michael Mountrakis Solutions Architect @UIT.GR


The first part describes how we can compile the WSDL from our OpenKM installation using the wsimport utility that comes with JDK1.6 and above. The produced client library JAR file is then imported in the Eclipse IDE in order to assist our development.

The example starts with a simple MSDOS batch file that generates the client library JAR to support the OpenKM Java Client like the one given in the official Wiki Web Services page

http://wiki.openkm.com/index.php/Java_client

The create_okm_client.bat is the following one:

rem set your javahome and your openKM host
set javahome=C:\jdk1.6.0_21
set okmhost=http://office.uit.gr:8888/OpenKM
rem -----------------------------------------
echo Creating OpenKM Clients
set wsimport=%javahome%\bin\wsimport.exe
set jar=%javahome%\bin\jar.exe 

echo Deleting old clients if exist.
del /f okm-ws-client.jar

%wsimport% -p com.openkm.ws.client %okmhost%/OKMAuth?wsdl
%wsimport% -p com.openkm.ws.client %okmhost%/OKMDocument?wsdl
%wsimport% -p com.openkm.ws.client %okmhost%/OKMFolder?wsdl
%wsimport% -p com.openkm.ws.client %okmhost%/OKMSearch?wsdl
%wsimport% -p com.openkm.ws.client %okmhost%/OKMNotification?wsdl
%wsimport% -p com.openkm.ws.client %okmhost%/OKMRepository?wsdl

echo Packaging to a jar 
%jar% cvf okm-ws-client.jar com

echo Deleting temporary directory  
del /f /s /q com

We run the program as a command line in the MS DOS prompt. Uppon successful completion, the file okm-ws-client.jar will be produced.

Next step is to add the okm-ws-client.jar to your Eclipse project:

Eclipse.png