Saturday, 17 June 2017

OER -AUTHTOKEN AND USE IN REX CALLS USING JAVA

AuthToken and use in REX Calls  Using Java

a)Import the below mentioned jars from OER Installation path àMW_HOME/oer/applications/oer-app/WEB-INF/lib

* 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

b)Go to OER console à 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  as shown in below screenshot –








Save the settings

c) Add  the downloaded jars as mentioned in step: a to classpath which are available under WEB-INF/lib  folder.



















d) Compile the java code as shown below  --

packagecom.example.flashlineclient;

importcom.flashline.registry.openapi.entity.AuthToken;
import com.flashline.registry.openapi.service.v300.FlashlineRegistry;
import com.flashline.registry.openapi.service.v300.Flas




hlineRegistryServiceLocator;

import java.net.URL;

public class TestAuthToken {

FlashlineRegistry repo = null;

AuthTokenauthTokAdmin = null;

publicTestAuthToken() {
try {       
URL url = new URL("http://host:port/oer/services/FlashlineRegistry");
repo = new FlashlineRegistryServiceLocator().getFlashlineRegistry(url);
authTokAdmin = repo.authTokenCreate("username", "password");
System.out.println(authTokAdmin);
} catch (Exception e) {
e.printStackTrace();
}
}

/**
* @paramargs
*/
public static void main(String[] args) {
TestAuthToken test = new TestAuthToken();
System.out.println("success");
}

}



e) Test Your Services

On testing  it should print the authtoken as shown in below screenshot




No comments:

Post a Comment