cancel
Showing results for 
Search instead for 
Did you mean: 

Executing a RFC within a Portal Service

Former Member
0 Kudos

Hello All:

I'm trying to execute a RFC during the afterInit() function of my custom portal service. I've gotten the

call to work properly in an AbstractPortalComponent. However my problem is that when I put it in a service,

I don't have access to the request object and therefore I don't have an authenticated user for the

ConnectionProperties constructor.

IConnection con = null;
try {
	Object tempCon = PortalRuntime.getRuntimeResources().getService(IConnectorService.KEY);
	IConnectorGatewayService cgService = (IConnectorGatewayService) tempCon;
	ConnectionProperties prop = new ConnectionProperties(local,user);
	con = cgService.getConnection(connectionString, prop);
} catch (Exception ex) {
	ex.printStackTrace(System.err);
}

In the portal Service, I create my own IUser object:

IUserFactory userFactory = UMFactory.getUserFactory();
IUser user = userFactory.getUserByLogonID("myuserid");

and pass that user to the ConnectionProperties Constructor, but the getConnection() fails. Is there

some service user I can use? Or is there a way that I can force the IUser object in the service to be

authenticated (I would know the password).

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

hofmann
Active Contributor
0 Kudos

pass that user to the ConnectionProperties Constructor, but the getConnection() fails

Fails how exactly? The IPrincipal /IUser object passed isn't correct or does the backend not permit the connection? In the later case: is the SSO or user mapping for the system and user correctly configured?

Tobias

Former Member
0 Kudos

Dear M. Miller,

please find the solution and a detailed explanation in this [thread|;.

Best regards,

Martin