how to create an IdM session

I am writing a standalone Java program to login to IdM, then export some objects. However I fail to create a user session. Here is my code and the error I got.

String host = "http://localhost:8181/idm";

URL localurl = new URL (host);

String User = "myconfig";

EncryptedData ed = new EncryptedData("password");

I failed in both

Session mySession = SessionFactory.getSession(host, User,ed);

And

RemoteSession mySession = new RemoteSession(localurl, User, ed);

with error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/soap/SOAPException

[626 byte] By [thu26a] at [2007-11-27 2:39:27]
# 1

Hi,

import com.waveset.session.Session;

import com.waveset.session.SessionFactory;

import com.waveset.util.EncryptedData;

public class Test {

public static void main(String[] args) throws Exception {

EncryptedData ed = new EncryptedData("configurator");

Object o = SessionFactory.getSession("http://localhost:8088/idm/servlet/rpcrouter2","Configurator",ed);

System.out.println(o);

}

}

printed

com.waveset.session.RemoteSession@18f729c

for me.

The error you get implies that you do not have soap.jar in the classpath of your custom application. But even if you had the url you are using should point to the rpcrouter2 servlet of your installation.

The jars i needed to put in the classpath of my testapp

in order for it to get a session in IDM7 were:

activation.jar

idm.jar

idmclient.jar

idmcommon.jar

mail.jar

soap.jar

I think that activation, mail and possibly idm.jar should not

be needed to get a remote session but obviously they are.

Regards,

Patrick

Patrick.Wehingera at 2007-7-12 3:01:29 > top of Java-index,Web & Directory Servers,Directory Servers...