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

From OpenKM Documentation
Jump to: navigation, search
(Implementing a Java Client Web Service to consume OpenKM W/S Using Eclipse Part B)
(Implementing a Java Client Web Service to consume OpenKM W/S Using Eclipse Part B)
Line 54: Line 54:
 
File -> New -> Other
 
File -> New -> Other
  
 +
From the Wizards menu that appears, select the Web->Dynamic Web Project
 
[[File:eclipse_new_dynamic_web_project.png]]
 
[[File:eclipse_new_dynamic_web_project.png]]
  
  
 +
Follow the steps of the Dynamic Web Project Wizzard
 
[[File:eclipse_dynamic_web_project2.png]]
 
[[File:eclipse_dynamic_web_project2.png]]
  
<b>Step 1</b>
+
Follow the steps of the Dynamic Web Project Wizzard
Now the first
+
# Give your project a name, I named it MyOpenKmClient
 +
# Give your project a runtime. I have chosen the jboss-4.2.3.GA that comes with the OpenKM
 +
# Give your project a dynamic web module version. For that just leve the default 2.5
 +
# Don't select EAR deployement
 +
# Click <b>Next</b>
 +
 
 +
[[File:eclipse_dynamic_web_project3.png]]

Revision as of 22:15, 12 February 2011

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

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

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

Michael Mountrakis Solutions Architect @UIT.GR


The second part describes how to create a simple OpenKM Client using Eclipse only, without the wsimport utility.

Step 1 Now the first step is to create a new Dynamic Web Project in Eclipse IDE. Select from Left Upper Menu: File -> New -> Other

From the Wizards menu that appears, select the Web->Dynamic Web Project Eclipse new dynamic web project.png


Follow the steps of the Dynamic Web Project Wizzard Eclipse dynamic web project2.png

Follow the steps of the Dynamic Web Project Wizzard

  1. Give your project a name, I named it MyOpenKmClient
  2. Give your project a runtime. I have chosen the jboss-4.2.3.GA that comes with the OpenKM
  3. Give your project a dynamic web module version. For that just leve the default 2.5
  4. Don't select EAR deployement
  5. Click Next

Eclipse dynamic web project3.png