on 05-06-2005 2:58 PM
Hi,
my aim is to create web service form the portal service, I have to access the all pages navigational URL for particular Role. I have implemented already this logic in my Web Dynpro application but now I have to make web Service which is going to implement the same logic.
So what I am doing is I get the user as parameter then I check the Roles for user and then one by one I do lookup on uniqueRolename to get the IPcdContext then I pass the IPcdContext to another function which will then look for PagesURL.
Ok now before I use lookup I have to assign the user in Context environment I have done like this
InitialContext ic = new InitialContext(environment);
IUserFactory uf = UMFactory.getUserFactory();
IUser admin = uf.getUserByUniqueName("admin");
ic.addToEnvironment(Context.SECURITY_PRINCIPAL,admin);
But when it add admin in the enviorment it throws NamingException , I do not know what to do what this is there any other way?
Best Regards
Yasir Noman
Hi Yasir,
Change the
IUser admin = uf.getUserByUniqueName("admin");
to
IUser admin = uf.getUserByLogonID("admin");
pRAKASH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Parkash,
Well this thing is when I debug I see it retrieve the user Info but the time it when I add to Environment it makes problem So what I did add Initial_Context_Factory first then I add "Admin" to environment. But now the problem is coming when it reaches to last line it give me SOAPService error, I can see in debug that ic.lookup()returns the value but when it try to dipreciate it to IPcdContext it ask me in debug mode to reference the "Com.Sapportals.Portal.prt.Service.SOAP.Processor.SOAPPortalServicePro" could not find. I think I there should be different way to deal with IPcdContext in SOAP.
any idea regarding this?
InitialContext ic = new InitialContext(environment);
IUserFactory uf = UMFactory.getUserFactory();
IUser admin = uf.getUserByLogonUniqueName("admin");
ic.addToEnvironment(Context.INITIAL_CONTEXT_FACTORY, "com.sapportals.portal.pcd.gl.PcdInitialContextFactory");
ic.addToEnvironment(Context.SECURITY_PRINCIPAL,admin);
pcdCtx = (IPcdContext) ic.lookup(rolename);
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.