on 12-01-2004 12:52 PM
Hi,
in the documentation "How to Access a Portal Service Within a Web Dynpro Java Application" Jochen Guertler mentioned that it could lead to problems if one wants to use portal services from remote portal servers.
I understand that the described way just accesses local portal services.
Does anybody know how to access the services from remote servers?
Thx in advance
Helmut
Hello,
It is not possible to access to the portal registry in remote but we can use the portal webservice.
You can create a portal webservice (it a portal service with the webservice extensions) with a method String getInfoFromRegistry(String key) but we cannot tranfer the registry or an object as portal service or JNDI context.
If you want to acces to the portal service outside of th eportal tranform the portal service in portal webservice.
So careful about the security , because the portal registry is more critical, setup the good security zone on the webservice to restrict the access
Best Regards,
Fabrice
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Helmut,
the actual code when calling WDPortalUtils.getServiceReference(String) is a simple, local JNDI lookup:
public Object getServiceReference(String serviceName) {
Hashtable environment = new Hashtable();
environment.put("java.naming.factory.initial",
"com.sapportals.portal.prt.registry.PortalRegistryFactory");
try {
InitialContext ic = new InitialContext(environment);
return ic.lookup("broker/services/" + serviceName);
} catch(Exception e) {
// [...] some exception handling
}
return null;
}
So you would have to pass the PROVIDER_URL and would have to use a different INITIAL_CONTEXT_FACTORY, I suppose.
This is definitely not supported by WebDynpro standards.
Hope it helps
Detlev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Detlev,
thanks for your answer but this is just a brick in the wall.
If I´m using your suggestion, I will first get a compile time error (of course I can solve this by copying the jar files to my computer and set the build path to these files).
But I don´t know the correct solution for the following runtime error. This will occur because at my Web AS there is no Portal installed and so the portal service classes will not be found.
I could create a library project that encloses the needed jar files and deploy them to my Web AS. The library I could then reference in my WD project.
But will this work in reality? Does anyone have experience with external service invocation?
Regards
Helmut
Hi Helmut,
of course you will have to use some lib's of the aimed system, but's that's the way...
See /thread/21357 [original link is broken] where I have built up the way into J2EE engine, the open question is if the portal registry is bound into the J2EE servers context somehow or if not - if it is accessible directly and remotely.
Best regards
Detlev
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.