on 07-28-2008 2:12 PM
Dear all,
I would like to read the UWL task list from java webdynpro.
I have followed this blog:
[Flashy UWL |https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/5450] [original link is broken] [original link is broken] [original link is broken];
The uwl is working in the portal, there are tasks for my user.
here is my code,
IUWLService uwlService = (IUWLService) WDPortalUtils.getServiceReference(IUWLService.ALIAS_KEY);
UWLContext uwlContext = new UWLContext();
IUserFactory userfactory = UMFactory.getUserFactory();
try {
IUser loggedinuser = UMFactory.getAuthenticator().getLoggedInUser();
uwlContext.setAllowBackEndConnections(true);
uwlContext.setUser(loggedinuser);
uwlContext.setLocale(loggedinuser.getLocale());
IUWLSession mySession = uwlService.beginSession(uwlContext, 50);
// IUWLSession mySession = uwlService.getUwlSessionForWebDynproClient(uwlContext);
uwlContext.setSession(mySession);
IUWLItemManager itemManager = uwlService.getItemManager(uwlContext);
QueryResult result = itemManager.getItems(uwlContext, null, null);
and at the last line I receive the the exception:
com.sap.netweaver.bc.uwl.UWLException: Logged in users context or session doesn't exist
mySession.isValid() gives true, logged in user is ok, even the locale attribute.
I have added tckmcbc.uwl~api into project properties library reference.
I am useing sap.authentication true wd app property to log in, but I tried portal iview as well, same result.
Please suggest, what is missing? Maybe one application is not running? Something needs to be added to the wd references?
Thank you in advance,
Tamas
Dear all,
my problem has been solved, I can reach the UWL from WD Java.
I just had to use this
IWDClientUser wdUser = WDClientUser.getCurrentUser();
IUser loggedinuser = wdUser.getSAPUser();
instead of this
IUser loggedinuser = UMFactory.getAuthenticator().getLoggedInUser();
Does anybody know what is the difference?
Regards,
Tamas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.