Given that you are able to create a project a your IDE, carry out the following two exercise to connect to OIM to execute your APIs:
- Writing the code
- Importing the necessary jars
Code:
import java.util.Hashtable;
import javax.security.auth.login.LoginException;
import oracle.iam.platform.OIMClient;
public class OimConnection {
private static final String OIM_URL = "t3://iamsoaguru.local.com:14000";
private static final String AUTH_CONF = "C://Rohit//designconsole//config//authwl.conf";
protected static final String OIMUSERNAME = "xelsysadm";
protected static final String OIMPASSWORD = "Welcome1";
protected OIMClient oimClient = null;
public OIMClient BaseClient() {
System.setProperty("APPSERVER_TYPE", "wls");
System.setProperty("java.security.auth.login.config", AUTH_CONF);
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(OIMClient.JAVA_NAMING_FACTORY_INITIAL,
"weblogic.jndi.WLInitialContextFactory");
env.put(OIMClient.JAVA_NAMING_PROVIDER_URL, OIM_URL);
oimClient = new OIMClient(env);
try {
oimClient.login(OIMUSERNAME, OIMPASSWORD.toCharArray());
System.out.println("BaseClient.BaseClient() Login SUCCESS");
} catch (LoginException e) {
System.out.println("Exception in getting oimConnection");
e.printStackTrace();
}
return oimClient;
}
}
Required Jars:
- Commons-logging.jar
- Eclipselink.jar
- Jrf-api.jar
- OIMClient.jar
- Spring.jar
- WLFullClient.jar
can't find the OIMClient.jar file anywhere..
ReplyDelete