Classpath for running OIM API's externally

Hello there,
Can I please know the names of the JAR's that are needed to be included in the CLASSPATH variable to run the following code:
import com.thortech.util.logging.Logger;
import java.util.HashMap;
import java.util.Hashtable;
import Thor.API.tcResultSet;
import Thor.API.tcUtilityFactory;
import Thor.API.Exceptions.tcAPIException;
import Thor.API.Exceptions.tcChallengeNotSetException;
import Thor.API.Exceptions.tcColumnNotFoundException;
import Thor.API.Exceptions.tcLoginAttemptsExceededException;
import Thor.API.Exceptions.tcPasswordExpiredException;
import Thor.API.Exceptions.tcPasswordResetAttemptsExceededException;
import Thor.API.Exceptions.tcUserAccountDisabledException;
import Thor.API.Exceptions.tcUserAccountInvalidException;
import Thor.API.Exceptions.tcUserAlreadyLoggedInException;
import Thor.API.Operations.tcUserOperationsIntf;
import com.thortech.xl.util.config.ConfigurationClient;
import java.lang.System;
public class SearchUserAttribs
public SearchUserAttribs()
public void findUser() throws tcColumnNotFoundException, tcAPIException,
tcChallengeNotSetException,
tcLoginAttemptsExceededException,
tcPasswordResetAttemptsExceededException,
tcPasswordExpiredException,
tcUserAccountDisabledException,
tcUserAccountInvalidException,
tcUserAlreadyLoggedInException
ConfigurationClient.ComplexSetting config = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
Hashtable env = config.getAllSettings();
tcUtilityFactory ioUtilityFactory = new tcUtilityFactory(env,"xelsysadm","test1234");
tcUserOperationsIntf userIntf=(tcUserOperationsIntf)ioUtilityFactory.getUtility("Thor.API.Operations.tcUserOperationsIntf");
String userId = "[email protected]";
HashMap userMap = new HashMap();
userMap.put("usr_login", userId);
try
tcResultSet userSet = userIntf.findUsers(userMap);
System.out.println("ROWS" + userSet.getRowCount());
for(int i =0; i< userSet.getRowCount(); i++)
userSet.goToRow(i);
long userKey = userSet.getLongValue("Users.Key");
System.out.println("userKey :: :: " +userKey);
} catch (tcAPIException e)
throw new RuntimeException("Unable to create API instance" + "instance", e);
public static void main(String args[]) throws tcColumnNotFoundException, tcAPIException,
tcChallengeNotSetException,
tcLoginAttemptsExceededException,
tcPasswordResetAttemptsExceededException,
tcPasswordExpiredException,
tcUserAccountDisabledException,
tcUserAccountInvalidException,
tcUserAlreadyLoggedInException
//System.setProperty("XL.HomeDir","/usphlsoweb07/u13/sg20/app/mwora/10.3.0/oim/xellerate/");
// System.setProperty("java.security.auth.login.config","usphlsoweb07.sas.sungardrs.com/u13/sg20/app/mwora/10.3.0/oim/xellerate/config/authwl.conf");
// System.setProperty("java.security.policy","/usphlsoweb07/u13/sg20/app/mwora/10.3.0/oim/xellerate/config/xl.policy");
// System.setProperty("log4j.configuration","/usphlsoweb07/u13/sg20/app/mwora/10.3.0/oim/xellerate/config/log.properties");
// private static Logger LOGGER = Logger.getLogger("Xellerate.WebApp");
SearchUserAttribs sua=new SearchUserAttribs();
sua.findUser();
System.out.println("Back to Main function");
I am getting a lot of crap errors just because of the classpath related to thor.api exceptions and logging. Please let me know.
Thanks,
- oidm.

Thanks for the reply Kevin.
Below is the modified code:
package project1;
import Thor.API.Exceptions.tcAPIException;
import Thor.API.Exceptions.tcChallengeNotSetException;
import Thor.API.Exceptions.tcColumnNotFoundException;
import Thor.API.Exceptions.tcLoginAttemptsExceededException;
import Thor.API.Exceptions.tcPasswordExpiredException;
import Thor.API.Exceptions.tcPasswordResetAttemptsExceededException;
import Thor.API.Exceptions.tcUserAccountDisabledException;
import Thor.API.Exceptions.tcUserAccountInvalidException;
import Thor.API.Exceptions.tcUserAlreadyLoggedInException;
import Thor.API.Operations.tcUserOperationsIntf;
import Thor.API.tcResultSet;
import Thor.API.tcUtilityFactory;
import com.thortech.xl.util.config.ConfigurationClient;
import java.lang.System;
import java.util.HashMap;
import java.util.Hashtable;
public class Class1 {
public static void main(String[] args) throws tcColumnNotFoundException,
tcAPIException,
tcChallengeNotSetException,
tcLoginAttemptsExceededException,
tcPasswordResetAttemptsExceededException,
tcPasswordExpiredException,
tcUserAccountDisabledException,
tcUserAccountInvalidException,
tcUserAlreadyLoggedInException
tcUtilityFactory ioUtilityFactory = null;
System.out.println("Startup...");
System.out.println("Getting Configuration...");
System.setProperty("XL.HomeDir", "F:/oim/oimserver/xellerate");
System.setProperty("log4j.configuration",
"F:/oim/oimserver/xellerate/config/log.properties");
System.setProperty("java.security.policy",
"F:/oim/oimserver/xellerate/config/xl.policy");
System.setProperty("java.security.auth.login.config",
"F:/oim/oimserver/xellerate/config/*authwl.conf*");
System.setProperty("java.naming.provider.url",
"jnp://localhost:1099 ");
ConfigurationClient.ComplexSetting config =
ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
System.out.println("Login...");
Hashtable env = config.getAllSettings();
try {
ioUtilityFactory =
new tcUtilityFactory(env, "xelsysadm", "mypassword");
System.out.println("Authenticated .... ");
} catch (Throwable e) {
System.out.println("Authentication Failed --- ");
e.printStackTrace();
if (ioUtilityFactory != null) {
System.out.println("Login OK");
System.out.println("Getting Utility Interfaces ... ");
tcUserOperationsIntf userIntf =
(tcUserOperationsIntf)ioUtilityFactory.getUtility("Thor.API.Operations.tcUserOperationsIntf");
System.out.println("Started Processing... ");
String userId = "[email protected]";
HashMap userMap = new HashMap();
userMap.put("usr_login", userId);
try {
tcResultSet userSet = userIntf.findUsers(userMap);
System.out.println("ROWS" + userSet.getRowCount());
for (int i = 0; i < userSet.getRowCount(); i++) {
userSet.goToRow(i);
long userKey = userSet.getLongValue("Users.Key");
System.out.println("userKey :: :: " + userKey);
System.out.println("Done!");
ioUtilityFactory.close();
} catch (tcAPIException e) {
e.printStackTrace();
Still the errors are:
Startup...
Getting Configuration...
Login...
log4j:WARN No appenders could be found for logger (com.opensymphony.oscache.base.Config).
log4j:WARN Please initialize the log4j system properly.
GMS: address is imserver1:2566
Authentication Failed ---
Thor.API.Exceptions.tcAPIException
     at Thor.API.tcUtilityFactory.getPropertyValue(Unknown Source)
     at Thor.API.tcUtilityFactory.<init>(Unknown Source)
     at project1.Class1.main(Class1.java:59)
Getting Utility Interfaces ...
Exception in thread "main" java.lang.NullPointerException
     at project1.Class1.main(Class1.java:74)
What's wrong over here? It's giving me the error right at the spot where I am passing the credentials to login. Please advice.
- oidm.

Similar Messages

  • How to call OIM API from external app?

    Hi,
    I have an java application and I would like to call OIM API to accept a request. The application resides in separate server than OIM.
    My questions:
    *1.* What to do to call OIM API from external application (import any OIM jars etc.)?
    *2.* Which method to use, setRequestResponse , closeRequest or any other?
    I appreciate any help, thanks.
    Edited by: m.m. on Feb 2, 2010 5:33 AM

    Hello,
    If it is an external client, you need to provide the "login" and "password" details explicitly in the code (something like this), before getting any other Interface control to invoke the OIM APIs -
    public class OIMAPIClientTest {
    public static void main(String[] args) {
    try{
    System.out.println("Starting...");
    ConfigurationClient.ComplexSetting config = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
    Hashtable env = config.getAllSettings();
    tcUtilityFactory ioUtilityFactory = new tcUtilityFactory(env,"xelsysadm","abcd1234");
    System.out.println("Getting utility interfaces...");
    Regards,
    Amit
    Edited by: amitKumar on Feb 2, 2010 5:29 AM

  • Error when run OIM API in eclipse

    Hi everyone,
    I am using WAS 6.1 and OIM 9.1.02. When I try to use OIM API it gives me the following error. However, it runs perfectly with JBOSS
    Exception in thread "main" java.lang.NoClassDefFoundError: com.ibm.websphere.security.auth.callback.WSCallbackHandlerImpl
         at Thor.API.Security.LoginHandler.websphereLoginHandler.login(Unknown Source)
         at Thor.API.Security.ClientLoginUtility.login(Unknown Source)
         at Thor.API.tcUtilityFactory.<init>(Unknown Source)"*
    Code below:
    public class FirstAPITest {
    public static void main(String[] args) {
    try{
    System.out.println("Startup...");
    System.out.println("Getting configuration...");
    ConfigurationClient.ComplexSetting config =
    ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
    System.out.println("Login...");
    Hashtable env = config.getAllSettings();
    tcUtilityFactory ioUtilityFactory = new tcUtilityFactory(env,"xelsysadm","welcome1");
    System.out.println("Getting utility interfaces...");
    tcUserOperationsIntf moUserUtility =
    (tcUserOperationsIntf)ioUtilityFactory.getUtility("Thor.API.Operations.tcUserOperationsIntf");
    Hashtable mhSearchCriteria = new Hashtable();
    mhSearchCriteria.put("Users.First Name", "System");
    tcResultSet moResultSet = moUserUtility.findUsers(mhSearchCriteria);
    for (int i=0; i<moResultSet.getRowCount(); i++){
    moResultSet.goToRow(i);
    System.out.println(moResultSet.getStringValue("Users.Key"));
    System.out.println("Done");
    }catch (Exception e){
    e.printStackTrace();
    System.exit(0);
    Thanks,
    ANI

    Try This Link :Create User In OIM Using OIM API's
    & replace following with websphere info.
    env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");//For Weblogic
    env.put("java.naming.provider.url","t3://localhost:7001");//For Weblogic
    System.setProperty("java.naming.provider.url","t3://localhost:7001 ");//For Weblogic
    Pls check & reply.

  • External Calls to OIM API

    I am using OIM 9.1.0.1 as a standalone system.
    i want to call OIM API to create user.
    I have a created a custom JSP page.
    How can i call OIM API to create user in OIM.
    Thanks.

    {color:#000080}You can use the following to invokel OIM APIs from external WebApps:
    {color} private static tcUtilityFactory _util = null;
    static {
    ConfigurationClient.ComplexSetting config = ConfigurationClient
    .getComplexSettingByPath("Discovery.CoreServer");
    try {
    final Hashtable env = config.getAllSettings();
    _util = new tcUtilityFactory(env, "xelsysadm", &lt;pwd&gt;);
    } catch (Exception e) {
    e.printStackTrace();
    public Object getObjectReference(String qualifiedObjectName) {       
    return util == null ? null : (tcUtilityOperationsIntf) util
    .getUtility(qualifiedObjectName);
    {color:#000080}Create an instance of the above class and invoke 'getObjectReference(...)'{color}
    E.g.:
    tcUserOperationsInft _usrOpRef = (tcUserOperationsIntf) )new &lt;ClassName&gt;().getObjectReference("Thor.API.Operations.tcUserOperationsIntf");and then invoke any of the methods from user API class
    {color:#000080}Hope this helps{color}
    Now for creating user, all you have to do is:

  • Exposing OIM APIs as webservice

    Hi,
    I wanted to know if i can expose OIM APIs as webservice?
    As per my reqmnt, i need to implement forgot password and change password functionality for OIM users from a portal application.
    So wanted to know if I can use OIM APIs say getChallengeValuesForSelf , compareChallengeValuesForSelf, changePasswordForSelf and then expose them as webservice?

    Can I do this...
    Create a WebService using NetBeans Editor...
    In it add a web method, which basically is using OIM API say getChallengeValuesForUser to fetch some value and then returning it as output of this web method?
    I'll be setting all the system properties required for calling OIM API here itself and also would make the connection to OIM here.
    I tried doing so, but getting an exception while I try to deploy the webservice,
    com.sun.xml.ws.model.RuntimeModelerException: The web service defined by the class weblogic.wsee.async.AsyncResponseBeanSoap12 does not contain any valid WebMethods.
    Kindly suggest.

  • OIM API portablity issue  with OIM 9.1 / Weblogic 10.3

    Hi , We have a existing piece of code which does some User Mutation through OIM API.
    [I am not well versed with OIM ]
    The code was running fine with Weblogic 8.3 and previous OIM version.
    Here is the piece of code.
    logger.info("Initializing OIM Params from config location:" oimConfigFileUtil.getOIMConfigBase());+*
    +          System.setProperty("XL.HomeDir", oimConfigFileUtil.getOIMConfigBase().getAbsolutePath());+
    +          System.setProperty("java.security.auth.login.config", oimConfigFileUtil.getOIMAuthWLFile().getAbsolutePath());+
    +          ConfigurationClient.ComplexSetting configClient = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");+
    +          env = configClient.getAllSettings();+
    *+          try {+*
    +               oimAccessFactory = new tcUtilityFactory(env, oimConfigFileUtil.getUserID(), oimConfigFileUtil.getPassword());+
    I traced all the dependecy's for this piece of code.
    If I run this with Weblogic.jar[8.1] it gives me
    java.io.InvalidClassException: com.thortech.xl.dataaccess.tcDataSet; local class incompatible: stream classdesc serialVersionUID = -5446056666465114187, local class serialVersionUID = -8857647322544023100*
    With the compatablity issue I substituted with weblogic.jar:10.3 , now its giving me all classpath issues.
    Can someone layout the exact jars that are required for this to work?
    Thanks
    Vignesh

    Installl a Design Console. Copy any files that are required. Then take the class paths that are listed in the classpath and basecp files and put those into your application classpath files.
    -Kevin

  • Enabling a User through OIM API

    Hi I am trying to enable a user through OIM API, However the end date is already passed for that user, I am setting up a new end date through the Program (showm below). However the update user is not working (i am not sure).
    Map usermap = new HashMap();
    usermap.put("Users.User ID", User_id );
    Map grpmap = new HashMap();
    grpmap.put("Groups.Group Name", Group_Name);
    tcResultSet ts = userClient.findUsers(usermap); //find all users
    String existing_end_date = ts.getStringValue("Users.End Date");
    tcResultSet tg = groupClient.findGroups(grpmap); //find requireq group
    long ukey = ts.getLongValue("Users.Key");
    long gkey = tg.getLongValue("Groups.Key"); //find group key
    // ENABLE THE USER
    java.util.Date new_end_date = new java.util.Date(111,1,1);
    Calendar cal = Calendar.getInstance();
    cal.setTime(new_end_date);
    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
    String Str1 = dateFormat.format(cal.getTime());
    String Str2 = existing_end_date + " 12:00:00";
    System.out.println(User_id+" OLD End Date:" + Str2 + " New End Date: " + Str1);
    Map usermap2 = new HashMap();
    usermap2.put("Users.User ID", User_id );
    usermap2.put("Users.End Date", Str1);
    userClient.updateUser(ts,usermap2);
    userClient.enableUser(ukey);
    I am getting the following error:
    U0000018 OLD End Date:2009-09-30 12:00:00 New End Date: 2011-02-01 12:00:00
    2/12/2010 15:02:53 oracle.j2ee.rmi.RMIMessages EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER
    WARNING: Exception returned by remote server: {0}
    Thor.API.Exceptions.tcAPIException: The user cannot be enabled because the end date is passed.
    Not sure why it is happening. It looks like the Updateuser is not working, or something else?
    Please advise. Thanks in advance.

    Hi Suren,
    thanks for the note.
    I found that as soon as I enable the user, I am getting the followimg messages in the opmn logs:
    INFO,06 Dec 2010 10:55:41,841,[XELLERATE.JAVACLIENT],System Event Handler: Validating Organization for an User.
    INFO,06 Dec 2010 10:55:41,944,[XELLERATE.JAVACLIENT],System Event Handler: Triggering Processes related to User.
    INFO,06 Dec 2010 10:55:42,402,[XELLERATE.JAVACLIENT],System Event Handler: Enabling the User
    INFO,06 Dec 2010 10:55:42,421,[XELLERATE.JAVACLIENT],System Event Handler: Validating Organization for an User.
    INFO,06 Dec 2010 10:55:42,427,[XELLERATE.JAVACLIENT],System Event Handler: Triggering Processes related to User.
    INFO,06 Dec 2010 10:55:42,439,[XELLERATE.JAVACLIENT],System Event Handler: Changing application data based on Organization change.
    INFO,06 Dec 2010 10:55:42,442,[XELLERATE.JAVACLIENT],System Event Handler: Auto-Group Membership Event.
    INFO,06 Dec 2010 10:55:43,715,[XELLERATE.JAVACLIENT],System Event Handler: Evaluating User Policies
    So, the access policies are getting evaluated, triggering provisioning processes.
    What I am planning to do is, to disable the access policies and try to run the Program.
    Because of this issue, my Program is throwing an error (until I looked into the opmn logs, it doesn't make sense).
    6/12/2010 10:55:50 oracle.j2ee.rmi.RMIMessages EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER
    WARNING: Exception returned by remote server: {0}
    Thor.API.Exceptions.tcAPIException: Error occurred enabling Xellerate User instance.
    Regards
    Vijay Chinnasamy

  • Request Approval using OIM API

    Hi all
    Which API I need to use to approve a resouce request using OIM API?
    I have tried with the following:
    tcReqOp.setRequestResponse(85, 1 , "java.lang.String psResponse");
    i do not know what to pass in place of java.lang.String psResponse.
    I aslo tried passing "C","Completed"
    can anyone correct what I am doing?
    Thank u
    sas

    I assume you want to run a scheduled task for this. Try this approach. Run this query to retrieve specific approval tasks that are in a pending state:
    select oti.sch_key, mil.mil_name, to_char(oti.oti_update, 'dd-mon-yyyy hh24:mi:ss')
    from oti, mil, obj, pkg, orc, sch
    where oti.mil_key=mil.mil_key
    and oti.pkg_key=pkg.pkg_key
    and pkg.obj_key=obj.obj_key
    and oti.orc_key=orc.orc_key
    and oti.sch_key=sch.sch_key
    and oti.sch_status='P'
    and obj.obj_name='Test Object'
    and pkg.pkg_type='Approval'
    You can modify the obj.obj_name or remove, or do any changes you want. When you grab the time of the oti.oti_update, compare it against the sysdate to determine the time difference. If the update did not occur within that time, use this code:
    provIntf = (tcProvisioningOperationsIntf)getUtilityOps("Thor.API.Operations.tcProvisioningOperationsIntf");
    Hashtable taskHash = new Hashtable();
    taskHash.put("Process Instance.Task Details.Data", "<Insert Response Value Here>");
    provIntf.updateTask(key, taskHash) ; //---> Key is the same as the oti.sch_key field
    I have not tried this, but give it a shot.
    -Kevin

  • Configuring runtime classpath for portal applications?

    G'day,
    I've got a portal application that uses the classes found in system/kernel.jar and system/frame.jar. When I build the portal application in the IDE I can add these to the build path as external jars, but when I run the portal application I get "class not found" errors.
      java.lang.NoClassDefFoundError: com/sap/engine/core/Framework
    So ... how do I add these jar files to the portal application's runtime classpath?
    --Geoff

    Hi Geoffrey
    Jar files are required in two ways:
    For Design time: User external jars(as you have done)
    For Run time: Put the jar files in the lib folder(this way the par/ear ) itself will contain the jar files.
    Right click the project - >properties->java build path->libraries-> Add Jars (and not Add External Jars)->select your project->dist->PORTAL-INF->lib->select the jar file.
    Hope it helps.

  • Call OIM APIs

    Hello,
    I am writing a java program to call the OIM APIs to reset a user's password and set up security questions.
    First in my java program I need to make a connection to OIM URL. Example of my URL is: http://lenovo-d0446ff6.:7778/xlWebApp/
    What API in OIM may I use to establish the connection or is there another way to connect to OIM via some java code.
    Thanks

    I followed the OIM API Usage Guide and the Getting started with OIM API's using Eclipse.
    When I ran FirstAPITest, I got the following error message:
    Startup...
    Getting configuration...
    Login...
    log4j:WARN No appenders could be found for logger (XELLERATE.ACCOUNTMANAGEMENT).
    log4j:WARN Please initialize the log4j system properly.
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/ejb/EJBHome
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:164)
         at com.thortech.xl.ejb.interfaces.tcUnauthenticatedOperationsUtil.class$(Unknown Source)
         at com.thortech.xl.ejb.interfaces.tcUnauthenticatedOperationsUtil.getHome(Unknown Source)
         at Thor.API.Security.LoginHandler.oracleLoginHandler.handleOracleClientLogin(Unknown Source)
         at Thor.API.Security.LoginHandler.oracleLoginHandler.login(Unknown Source)
         at Thor.API.Security.ClientLoginUtility.login(Unknown Source)
         at Thor.API.tcUtilityFactory.<init>(Unknown Source)
         at FirstAPITest.main(FirstAPITest.java:16)
    I tried to search the forum for javax/ejb/EJBHome without success. Did I miss another jar?
    Thanks

  • Using OIM APIs

    I need to use OIM APIs from a third party web application.
    I would like to know, would it be possible as our OIM server would be at a different m/c then the client web application.
    So how would the settings be done in this case, as we set some system variables in the code for accessing the OIM APIs which include mentioning the path of Xellerate folder.
    Kindly guide.

    I have gone through this link, and have used OIM APIs earlier, but in that case both my code and the OIM server were running on the same m/c.
    But now its a third party web app which wants to call OIM APIs, hence I would like to knw, how d following settings would be done.
    System.setProperty("XL.HomeDir", "D:/NewOIM/xellerate");
    System.setProperty("java.security.policy", "D:/NewOIM/xellerate/config/xl.policy");
    System.setProperty("java.security.auth.login.config", "D:/NewOIM/xellerate/config/authwl.conf");
    System.setProperty("log4j.configuration", "D:/NewOIM/xellerate/config/log.properties");
    System.setProperty("java.naming.provider.url", "t3://blrkec87910d:7001");
    As uptil now I was giving the local location of these folders.
    But now how would I give it?

  • Custom Webservice Using OIM APIs

    Hi..
    How can we create and publish a custom webservice from OIM APIs??
    OOTB SPML Webservice does not support all my requirements.
    Thanks...

    The OOTB Web services are mostly asynchronous, so its not mostly suitable for our synchronous activity in OIM. like create,update,enable,disable etc
    So in order to develop the webservices...
    first of all list down all the methods which u need to publish.
    Write Java code for each methods..
    after that publish all methods as Webservices (JAX-WS) on Weblogic server where OIM is running.
    After that you can access your custom webservices of OIM.
    Regards,
    J

  • Create new schedule task using OIM API

    Hello,
    Steps for setting up eclipse :
    1)Create a new JAVA project.
    2)Right click on your newly created JAVA project & select properties.
    3)In Properties window select JavaBuildPath & select libraries tab.
    4)Click on AddExternalJar's button & add jar files from lib,ext folders of OIM client installation.
    5)Click OK.
    CODE<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<package oimscheduler;
    import java.util.HashMap;
    import java.util.Hashtable;
    import javax.naming.Context;
    import Thor.API.Operations.tcUserOperationsIntf;
    import Thor.API.Exceptions.tcAPIException;
    import Thor.API.Exceptions.tcChallengeNotSetException;
    import Thor.API.Exceptions.tcLoginAttemptsExceededException;
    import Thor.API.Exceptions.tcPasswordResetAttemptsExceededException;
    import Thor.API.Exceptions.tcUserAccountDisabledException;
    import Thor.API.Exceptions.tcUserAccountInvalidException;
    import Thor.API.Exceptions.tcUserAlreadyLoggedInException;
    import Thor.API.tcUtilityFactory;
    import com.thortech.xl.scheduler.tasks.SchedulerBaseTask;
    import com.thortech.xl.util.config.ConfigurationClient;
    public class Scheduler extends SchedulerBaseTask
         tcUtilityFactory ioUtilityFactory = null;
         @Override
         protected void execute()
              try
                   System.out.println("Executing Scheduler.....");
                   createConnection();
                   createUser();
                   System.out.println("Back In execute fn !!!");
              catch(Exception e)
                   System.out.println("Error In execute : "+e.toString());
         public void createConnection()
              try
                   System.setProperty("XL.HomeDir","D:\\Oracle\\OIM\\xellerate");
                   System.setProperty("java.security.policy","D:\\Oracle\\OIM\\xellerate\\config\\xl.policy");
                   System.setProperty("java.security.auth.login.config","D:\\Oracle\\OIM\\xellerate\\config\\authwl.conf");
                   System.setProperty("java.naming.provider.url","t3://localhost:7001 ");
                   System.out.println("Setting Configurations .....");
                   System.out.println("Starting .....");
                   ConfigurationClient.ComplexSetting config =
                   ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
                   System.out.println("Login...");
                   Hashtable env = config.getAllSettings();
                   env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
                   env.put("java.naming.provider.url","t3://localhost:7001");
                   ioUtilityFactory = new tcUtilityFactory(env,"xelsysadm","abcd1234");
              catch(tcAPIException ae)
                   System.out.println("Error In createConnection:tcAPIException "+ae.toString());
              catch(tcChallengeNotSetException cnse)
                   System.out.println("Error In createConnection:tcChallengeNotSetException "+cnse.toString());
              catch(tcLoginAttemptsExceededException laee)
                   System.out.println("Error In createConnection:tcLoginAttemptsExceededException "+laee.toString());
              catch(tcPasswordResetAttemptsExceededException praee)
                   System.out.println("Error In createConnection:tcPasswordResetAttemptsExceededException "+praee.toString());
    catch(tcUserAccountDisabledException uade)
         System.out.println("Error In createConnection:tcUserAccountDisabledException "+uade.toString());
    catch(tcUserAccountInvalidException uaie)
         System.out.println("Error In createConnection:tcUserAccountInvalidException "+uaie.toString());
    catch(tcUserAlreadyLoggedInException uale)
         System.out.println("Error In createConnection:tcUserAlreadyLoggedInException "+uale.toString());
              catch(Exception e)
                   System.out.println("Error In createConnection:Exception "+e.toString());
         public void createUser()
              System.out.println("<<< In createUser Fn >>>");
              try
                   tcUserOperationsIntf moUserUtility = (tcUserOperationsIntf)ioUtilityFactory.getUtility("Thor.API.Operations.tcUserOperationsIntf");
                   HashMap user = new HashMap();
                   user.put("Users.User ID","OIM-API-SCH");
                   user.put("Users.First Name","Oracle-SCH");
                   user.put("Users.Middle Name","JAVA-SCH");
                   user.put("Users.Last Name","SUN-SCH");
                   user.put("Organizations.Key","1");
                   user.put("Users.Role","Full-Time");
                   user.put("Users.Xellerate Type","End-User");
                   user.put("Users.Password","password");
                   long l = moUserUtility.createUser(user);
                   System.out.println("CreatingUser Done.....");
              catch(tcAPIException ae)
                   System.out.println("Error In createUser:tcAPIException "+ae.toString());
              catch(Exception e)
                   System.out.println("Error In createUser:Exception "+e.toString());
    After writing above code ,we have to create jar file.
    Steps To Be Follwed In OIM Design Console
    1)Copy jar file in ScheduleTask folder of your OIM server installation.
    2)Expand administration tree & select TaskScheduler.
    3)Create new task & in class name textfield we have to mention package.classname & mention appropriate values in other textfields & execute it.
    4)Check output.

    We need to override 2 methods while extending from SchedulerBaseTask i.e
    init() :- this method is run before execute by the scheduler .
    execute() :- is executed by the scheduler.
    Revised code :-
    package oimscheduler;
    import java.util.HashMap;
    import Thor.API.Operations.tcUserOperationsIntf;
    import Thor.API.Exceptions.tcAPIException;
    import com.thortech.xl.scheduler.tasks.SchedulerBaseTask;
    public class Scheduler extends SchedulerBaseTask
         tcUserOperationsIntf moUserUtility = null;
         @Override
         public void init()
              try
                   System.out.println("In Init");
                   moUserUtility = (tcUserOperationsIntf) this.getUtility("Thor.API.Operations.tcUserOperationsIntf");
              catch (tcAPIException e)
                   e.printStackTrace();
         protected void execute()
              try
                   System.out.println("Executing Scheduler.....");
                   createUser();
                   System.out.println("Back In execute fn !!!");
              catch(Exception e)
                   System.out.println("Error In execute : "+e.toString());
         public void createUser()
              System.out.println("<<< In createUser Fn >>>");
              try
                   HashMap user = new HashMap();
                   user.put("Users.User ID","OIM-API-SCH1");
                   user.put("Users.First Name","Oracle-SCH1");
                   user.put("Users.Middle Name","JAVA-SCH1");
                   user.put("Users.Last Name","SUN-SCH1");
                   user.put("Organizations.Key","1");
                   user.put("Users.Role","Full-Time");
                   user.put("Users.Xellerate Type","End-User");
                   user.put("Users.Password","password");
                   long l = moUserUtility.createUser(user);
                   System.out.println("CreatingUser Done.....");
              catch(tcAPIException ae)
                   System.out.println("Error In createUser:tcAPIException "+ae.toString());
              catch(Exception e)
                   System.out.println("Error In createUser:Exception "+e.toString());
    Edited by: Rahul Shah on Jul 11, 2011 4:16 AM

  • OIM Client application development using OIM API, when user password is not available

    I am developing a cleint application for OIM. The client application is a set of services, running on a separate server from where OIM is running.
    The OIM version used is 11gR2.
    As I look into the oimClient object, the login method takes username and password. As my application is in an SSO environment, I do not have the password for the user, and just have the user's login ID.
    If I am correct, the tcUtilityFactory allowed a digital signature option, to support scenarios like the above.
    Question is, does oimClient support similar functionality? I did not find any examples in the Oracle documentation.
    I will appreciate if someone can confirm a similar usage and provide me some sample code and configuration details.
    Thanks.
    -subrata

    Check: http://www.ateam-oracle.com/authenticating-oim-apis-without-end-users-password/
    -Bikash

  • How can I run iTunes on my external HD via a PC?

    My 54 GB iTunes library was transferred from a Mac to an external hd. I want to run iTunes via the external on an old Dell PC Inspiron 700m. I don't have enough hard drive space to transfer that 54 GB.
    I've tried changing the advanced preferences to point to the iTunes folder on the external, but that didn't work.
    I tried the 'choose a library' option with the shift open, and found no .itl file in any of the iTunes folders on the external, though all my music, video, album artwork, etc are there on the external in the correct folders. Is this a translation issue of the Mac files not having file extensions the PC recognizes?
    If you are kind enough to answer this request, please keep in mind that I haven't used a PC in almost 9 years, so I find doing anything on it challenging.

    Thank you for the reply!
    All the files were copied:
    Folders (with content):
    Album Artwork
    Automatically Add to iTunes
    iTunes Music
    Mobile Applications
    Previous iTunes Libraries
    Files:
    iTunes Library
    iTunes Library Extras.itdb
    iTunes Library Genius.itdb
    iTuens Music Library.xml
    sentinel

Maybe you are looking for