private static QName DocumentServiceName = new QName("http://endpoint.ws.openkm.com/", "OKMDocumentService");
public static void create(String host, String username, String password, OKMDocumentBean document) throws OKMException {
String token = "";
OKMAuthService authService = null;
OKMDocumentService docService = null;
OKMAuth okmAuth = null;
OKMDocument okmDocument = null;
Document doc = new Document();
try {
authService = new OKMAuthService(new URL(host + "/OKMAuth?wsdl"), AuthServiceName);
docService = new OKMDocumentService(new URL(host + "/OKMDocument?wsdl"), DocumentServiceName);
okmAuth = authService.getOKMAuthPort();
okmDocument = docService.getOKMDocumentPort();
BindingProvider bpAuth = (BindingProvider) okmAuth;
BindingProvider bpDocument= (BindingProvider) okmDocument;
bpAuth.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, host+"/OKMAuth");
bpDocument.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, host+"/OKMDocument");