cancel
Showing results for 
Search instead for 
Did you mean: 

User is not being fetched though the web service context is set.

Former Member
0 Kudos

Hi All,

I have the below code in a web service for fetching the user.

IUser user = null;

Properties p = new Properties();

p.put("domain", "true");

ApplicationWebServiceContext wsContext = (ApplicationWebServiceContext) new InitialContext(p).lookup("/wsContext/" + ApplicationWebServiceContext.APPLICATION_WSCONTEXT);

if (wsContext != null) {

user =UMFactory.getAuthenticator().getLoggedInUser(wsContext.getHttpServletRequest(),null);

}uwlContext.setUser(user);

uwlContext.setLocale(user.getLocale());

I see that when deploying the wsContext is not null , and it enters the if loop. The problem is with the line shown below.

user =UMFactory.getAuthenticator().getLoggedInUser(wsContext.getHttpServletRequest(),null);

Any clue what the probelm is ?

Accepted Solutions (0)

Answers (1)

Answers (1)

pramod_gopisetty1
Active Contributor
0 Kudos

Hi Vidya,

Try this :

user = WDClientUser.getCurrentUser().getSAPUser().getUniqueName();

IUser user = UMFactory.getUserFactory().getUserByLogonID(user);

Or

IUserFactory userfact = UMFactory.getUserFactory();

IUserMaint userMaint = userfact.getMutableUser(user);

Hope this helps.

Cheers-

Pramod