Hallo community,
following problem. I want to create a JCO-Coonection to backend SAP System by using information from landscape and usermanagment service in the pdk enviroment.
First step I made was to create a new user in KMUsers file.
part of KMUser:
user.application.id=SAPSystem
user.application.SAPSystem.additionallogondata=
user.application.SAPSystem.userencryptedpassword=pwd
user.application.SAPSystem.username=user
user.firstname=user
user.id=pwd
user.lastname=user
user.locale=de_de
user.password=pwd
user.roles=portal_demo, portal_admin
After this I configured system- an jcoDestination.xml so that the system has to use the UIDPW-Logon method.
part of system.xml:
Third step I made was to map portal user to a user of backend SAP system (see part of KMUser). After I made a successful test of jcoDestination to backend SAP system in landscape cockpit.
The last step I made was to create a JCO Connection to SAP System by using usermanagment service.
part of code:
ILandscapeService landscapeService = (ILandscapeService) request.getService(ILandscapeService.KEY);
Properties props = landscapeService.lookupJCOLoginParams("SAPSystem");
Locale locale = request.getLocale();
String language = locale.getLanguage();
if (language != null) {
props.setProperty("LANG", language.toUpperCase());
}
IUserManagementService umService = (IUserManagementService) request.getService(IUserManagementService.KEY);
IUserFactory userFactory = umService.getDefaultFactory();
IUser myUser= null;
try {
myUser = userFactory.getUser(request.getUser().getUserId());
} catch (UserManagementException ume){
}
ILogonDataBroker authen = myUser.getMappingInfo();
authen.enrich(request.getServletRequest(),props,landscapeService.lookupJCOSystem(sapSystem),landscapeService.lookupJCOLogonMethod(sapSystem));
JCO.Client jcoClient = JCO.createClient(props);
jcoClient.connect();
These Trial fails because the return value of function call "curentUser.getMappingInfo()" of was null.
Does anybody have an idea want kind of mistake i made. I don't have anybody