Thursday 8 June 2017

OER-How to invoke OER Using Java Rex Api

Perform below steps to update oer Console --

Start OER Server 
Enable the OpenAPI within the OER if it is not already enabled 
Go to Admin --> System Settings 
Search for cmee.extframework.enabled 
Make sure the cmee.extframework.enabled property is set to True 
Save the settings 


Java Jars -


Compile the Sample code using Java Compiler by specifying the following Jar files to classpath which are available under WEB-INF/lib folder 


* aler-axis-jaxrpc.jar 
* client.rex.jar 
* jaxp.jar 
* saaj.jar 
* soap.jar 
* activation.jar 
* xercesImpl.jar 
* orawsdl.jar 
* aler-axis.jar 
* commons-discovery.jar 
* commons-logging.jar 
* http_client.jar 
* mail.jar 
* jdom.jar 
* xalan.jar 


Code To Authenticate  With OER Server:



import java.net.URL; 

import com.flashline.registry.openapi.entity.AssetType; 
import com.flashline.registry.openapi.entity.AuthToken; 
import com.flashline.registry.openapi.query.AssetTypeCriteria; 
import com.flashline.registry.openapi.service.v300.FlashlineRegistry; 
import com.flashline.registry.openapi.service.v300.FlashlineRegistryServiceLocator; 


public class TestAuthToken { 

FlashlineRegistry repo = null; 

AuthToken authTokAdmin = null; 

public TestAuthToken() { 
try { 
URL url = new URL("http://ABCD/oer/services/FlashlineRegistry"); 
repo = new FlashlineRegistryServiceLocator().getFlashlineRegistry(url); 
authTokAdmin = repo.authTokenCreate("admin", "welcome1"); 
System.out.println(authTokAdmin); 
} catch (Exception e) { 
e.printStackTrace(); 



/** 
* @param args 
*/ 
public static void main(String[] args) { 
TestAuthToken test = new TestAuthToken(); 

No comments:

Post a Comment