D:\jdk1.6.0\bin>wsimport -d client -s client http://localhost:8080/OpenKM/OKMTest?wsdl
generate webservice client code .
test code.
generate webservice client code .
test code.
Code: Select all
package es.git.openkm.ws.endpoint.okmtestclient;
public class OKMTestClient {
/**
* @param args
*/
public static void main(String[] args) {
OKMTestService tservice = new OKMTestService();
OKMTest t = tservice.getOKMTestPort();
t.simple("-----333333-------wangmj-----222222-------");
}
}
Code: Select all
package es.git.openkm.ws.endpoint.client;
/**
* @author wangmingjie
*
*/
public class OKMAuthJavaClient {
/**
* @param args
*/
public static void main(String[] args) throws Exception{
OKMAuthService tservice = new OKMAuthService();
OKMAuth t = tservice.getOKMAuthPort();
String token = t.login("okmAdmin", "admin");
System.out.println("token="+token);
// String token="113401797164588045429421368826942 ";
OKMDocumentService documentService = new OKMDocumentService();
OKMDocument document = documentService.getOKMDocumentPort();
Document d = document.getProperties(token, "/okm:root/gwt架构图.jpg");
System.out.println(d.getAuthor()+"\n"+d.getPath()+"\n"+d.getUuid());
OKMFolderService folderService = new OKMFolderService();
OKMFolder folder = folderService.getOKMFolderPort();
Folder f = folder.getProperties(token, "/okm:root/1市场研究");
System.out.println(f.getAuthor()+"\n"+f.getPath()+"\n"+f.getUuid());
OKMNotificationService notificationservice = new OKMNotificationService();
OKMNotification n = notificationservice.getOKMNotificationPort();
n.subscribe(token, "/okm:root/1市场研究");
n.unsubscribe(token, "/okm:root/1市场研究");
OKMPropertyGroupService pgservice = new OKMPropertyGroupService();
OKMPropertyGroup pg = pgservice.getOKMPropertyGroupPort();
System.out.println(pg.getGroups(token, "/okm:root/1市场研究"));
OKMSearchService searchservice = new OKMSearchService();
OKMSearch s = searchservice.getOKMSearchPort();
System.out.println(s.findByKeywords(token, "合同").value.size());
t.logout(token);
}
}
Attachments
(48.86 KiB) Downloaded 637 times
Last edited by wangmj on Sat Jan 30, 2010 1:46 pm, edited 1 time in total.