Retrieve Portal Service from EJB
Hi All,
I am trying to use a custom Portal Service from an EJB application. I assume that I have to do the JNDI lookup for the service since I can not use the usual "PortalRuntime" to get the service instance.
Looking at the JNDI browser in the Visual Admin, I can't seem to find it. I have seen some code snippets on SDN for UWLService where lookup is done via "/broker/services/XXXX.KEY"
Any insight?
Thanks,
Hi,
Take a look at this similar post: /thread/412823 [original link is broken]
BRgds,
Simon
Similar Messages
-
hi developers,
I want to start a portal service from an ejb which runs on my portal server (this ejb is called from a r/3 system).
The portal service than has to do set km file authorizations.
Has anyone an idea how I can do this and which portal service is the best for this?
Thanx a lot
ChristophHi,
Take a look at this similar post: /thread/412823 [original link is broken]
BRgds,
Simon -
Is there a possibility to implement a Portal Services by EJB Bean?
Let suppose we have a Portal Service class ITestPortalService and EJB called TestEJB
Can we do this in this way or any other way?
public class TestBean implements javax.ejb.SessionBean, TestPortalServiceQuestion: Is there a possibility to implement a Portal Services by EJB Bean?
I don't think you can do this directly as the portal service is maintained and called from the irj (portal) application, while the EJB beans are called directly from the web application server (as far as I know).
The only think you could do is to have the Portal Service be a bridge, which basically only calls the EJB and returns the results. -
Hi All,
I am new to java web services.
I made web services from ejb with netbeans.
I like only some people to have access to this services with user and pass stored in database.
In other words I need authentication and authorization.
How can I do this?
RegardsWell it depends also on application server you are using.
It depends also on web service stack you are using.
For example here is the hint for glassfish (Metro):
http://java.sun.com/javaee/5/docs/tutorial/doc/bncbe.html#bncbn
Miro. -
Calling portal service from web service
Hello,
I'm trying to call portal service from web service. Is this possible? I'm getting an error.
For example, code:
IJCOClientService clientService = (IJCOClientService) PortalRuntime.getRuntimeResources().getService(IJCOClientService.KEY);
.. is generating exception:
java.lang.LinkageError: Class com/sapportals/portal/prt/runtime/IPortalRuntimeResources violates loader constraints
Do anybody knows what's wrong?
Best regards,
Josef MotlHi Josef,
Is the IJCOClientService located on the producer side or on the consumer side?
Amit -
How to call a portal service from a servlet
Hello all.
I have a functioning portal service that I would like to call from a servlet.
When I try to do so, I get a ClassCastException when I do this (on line two):
IPortalRuntimeResources runtimeResources = PortalRuntime.getRuntimeResources();
IDocumentPersistence docPer = (IDocumentPersistence) runtimeResources.getService(IDocumentPersistence.KEY);
However if I do the following I can get a generic IService and use reflection to invoke the method (in the IDocumentPersistence interface) that I want to invoke:
IPortalRuntimeResources runtimeResources = PortalRuntime.getRuntimeResources();
com.sapportals.portal.prt.service.IService aService = (com.sapportals.portal.prt.service.IService) runtimeResources.getService(IDocumentPersistence.KEY);
There must be a better way to use portal services (hopefully like scenario one above) in servlets. In web dynpro you can use portal services and cast them to the correct type. What am I missing?Hi Kim,
how did you integrate the references to your Portal Service Interface into your web application?
You should do this using the references in your application-j2ee-engine.xml, did you do this? It might be a problem with the classloader otherwise.
The way you are calling portal services does work normally, however it is not the recommended way as it is documented in the SAP documentation.
Please check the SAP documentation on how to access a portal service from a j2ee app:
http://help.sap.com/saphelp_nw70/helpdata/EN/42/9ddd0cbb211d72e10000000a1553f6/frameset.htm
Best regards,
Stefan Brauneis -
Calling a Portal Service from within a Web Dynpro DC
Hello,
I am trying to call a Portal Service from within a Web Dynpro development component without sucess.
Can anyone give me some hints on the necessary steps in order to accomplish this task?
Thanks
DizHi Diz,
I tried doing the same thing by following the steps as mentioned by you. Just to re iterate,
1. Created a DC "Portal Application Standalone" project by the name myservice.
2. Created a portal service inside myservice by the ame AmitsService.
3. Exposed IAmitsService.class in the public part.
4 Build and deployed the DC on server and tested it through an abstract portal component and it worked FINE !!
Now..
5. Created anoter DC of type WebDynPro
6. Added SAP_JTECHS -> epbc.prtapi._api as a "Used DC" with dependency build time and runtime
7. Specified the sharing reference in the properties as PORTAL:sap.com/myservice
8. Tried to reference the service using the following code..
IAmitsService portalservice=(IAmitsService)WDPortalUtils.getServiceReference(IAmitsService.KEY);
9.Build and deployed the DC.
10. When I run the application I am getting the following error
Processing HTTP request to servlet [dispatcher] finished with error.
The error is: com.sap.engine.frame.core.load.SAPNoClassDefFoundError: com/sapportals/portal/prt/service/IService
Exception id: [000D6008418B005C0000002C00000D200004163CE6719E1D]
PLEASE ADVISE -
Accessing portal service from abstract portal component
Hi
I have created a portal service where it contains getdata() and putdata(String) methods.
I have created a abstract portal component and trying to access the portal service from this component.
In portalapp.xml file of the portal component i have created the sharing reference and i have given the service name.
When i run the component it says service not found.
Please let me know if i have missed some things
Thanks and Regards
NagaKishoreHi Prakash
Sorry for the latereply.
find below the code for the interface
package com.sap.global;
import com.sapportals.portal.prt.service.IService;
public interface IGlobalContext extends IService
public static final String KEY = "IGlobalContext.GlobalContext";
public void putData(String strUserID,String strSessionID);
public String getData();
portalapp.xml file of the portal service.
<application>
<application-config/>
<components/>
<services>
<service name="GlobalContext">
<service-config>
<property name="className" value="com.sap.global.GlobalContext"/>
<property name="startup" value="true"/>
</service-config>
<service-profile>
<property name="Test" value="true"/>
</service-profile>
</service>
</services>
</application>
I am doing the following steps to access the portal service in the abstract portal component.
1. Add the portal service to the java build path of the abstract portal component.
2. do content method has the following code.
String userid ="",sessionid="";
response.write("Welcome");
try
IUserContext uc= request.getUser();
userid = uc.getLogonUid();
sessionid = request.getServletRequest().getSession().toString();
response.write("Iview "+userid);
IGlobalContext uid = (IGlobalContext)PortalRuntime.getRuntimeResources().getService(IGlobalContext.KEY);
uid.putData(userid,sessionid);
response.write(" Response from Service " + uid.getData());
}catch (Exception e)
response.write(e.toString());
3. portalapp.xml of abstract portal component
<application>
<application-config>
<property name="SharingReference" value="GlobalContext"/>
</application-config>
<components>
<component name="LandingPageComponent">
<component-config>
<property name="ClassName" value="com.satyam.landing.LandingPage"/>
</component-config>
<component-profile/>
</component>
</components>
<services/>
</application>
I am getting the following error.
Portal Runtime Error
An exception occurred while processing a request for :
iView : N/A
Component Name : N/A
Could not find portal application GlobalContext.
Exception id: 11:53_08/04/05_0095_1641450
See the details for the exception ID in the log file
Thanks in advance
Regards
NagaKishore -
Accessing custom Portal service from a java application
We have a custom portal service that connects to BW using xmla. How do you access this portal service from a java application. Not from web dynpro, jsp or servlet but from the java code.
Can we use the INITIAL_CONTEXT_FACTORY to get access to the portal service.
Thank You
D.KNow I tried the following:
I've added the prtapi.jar and the service's jar to the additional-lib folder and added the appropriate entries to library.txt and reference.txt.
Now I can obtain now the PortalRuntime, but this is not initialized.
Has anybody a solution for this problem? Help would be high appreciated!
Regards,
Matthias -
Call portal service from page or iview
Hello All,
I have an portal applction(PAR) which is returning a value suppose 'X'.
Now my requirement is to call this portal service from page.
How may i do this?
Regards.
Punit
Edited by: Punit Singh on Feb 25, 2011 9:30 PMHi
You can call the IPortalService API as in this [thread|how to call a portal service;
Regards
johann -
Consume Portal Service from J2EE web application
hi, i am a newbie to portal content development. My team have developed a J2EE web application to be run on the portal. Is it possible to consume a Portal Service from J2EE web application? If possible, deeply appreciate if you could provide some guidelines. Kindly advise. Thanks.
Hi Theodore Yu,
You need to expose your portal service as a webservice to consume it in a j2ee web application.
For exposing a portal service to webservice check this link
http://help.sap.com/saphelp_nw04/helpdata/en/43/cb213e578c0262e10000000a11466f/frameset.htm
Thanks,
Padmaja
Edited by: Padmaja Pedapudi on May 20, 2008 2:03 PM -
Cannot access Portal Service from Web dynpro DC
Hi all,
I cannot access the portal service from my web dynpro dc.
1. I created a Portal Service (say xxxservice) in a DC (say the DC name is testservice and the vendor is xx.com)
2. Created a public part under the testservice DC and added my classes to it.
3. Built and deployed the testservice DC.
Now,
4. I created a web dynpro DC.
5. In the used DC section added the public part of the testservice DC and also the epbc.prtapi._api.jar for build time and runtime with strong qualifier.
6. In the web dynpro "Sharing Reference", I added PORTAL:xx.com/testservice
7. In the component controller, I am calling a method from the Portal Service.
8. Built the web dynpro DC and deployed it.
9. But at the run time it gives, NoClassDefFoundError on the xxxservice.
I looked at many forum threads and tried everything. For eg: changed the Sharing Reference to PORTAL:sap.com/testservice but nothing works.
Please do suggest me if I am missing something
ThanksHi Laxmi,
I am sure something wrong at Portal Service DC creation. On webdynpro part you done fine .. by putting PORTAL:sap.com/testservice
Check the below steps:
1. Create DC Portal Applicaiton Stand alone (SDA)
2. Add portal Service for the newly created portal service dc
3. build and activate
4. by default you should be get public part by name API which is compilation dependency
5. here you dont need to do anything else
6. on webdynpro just add the used dc to this API public part of portal service dc
7. add PORTAL:sap.com/testservice sharing reference
If u go by this you shouldnt get any error..
Now, u are saying something like ur own classes .. i think u are trying to put u r own classes to service.. but remeber portal service is to have only IYourService class and YourService class.. other classes should be made to be jar.. and add that jar to External library DC and create PPs compile & Assemble and add that DC to current service dc.
Hope it is clear.. if not pls let me know..
Thanks,
Raags -
Can i call portal service from a j2ee application?
Hi Experts,
Can i call portal service from a j2ee application?
If yes then how?
If no then is there any other way to achieve the same?
I m reffering this link:
http://help.sap.com/saphelp_nw2004s/helpdata/en/42/9ddd0cbb211d72e10000000a1553f6/content.htm
but not getting any help
Please help me out.Hi,
Can you check this link?
http://help.sap.com/saphelp_nw04s/helpdata/en/82/6a0e7bbe744276bf393654b9b576ed/content.htm
Regards
Srinivasan T -
Calling Web Service from EJB using HTTP Client
Hi,
Scenario:
I need to Call a Web Service from an EJB Application.I used HttpClient for calling the Web Service in the EJB Application. When i call the execute method of the HttpCLient it throws an exception
The element type "META" must be terminated by the matching end-tag "</META>"
The input XML does not have a node called META.
When i call the Web Service using Http Client form an Java Application it is working fine.
Kindly Suggest me the changes/steps that needs to be done
Regards,
S.V.Satish KumarHi Manish,
SOAP adapter does pass the message to XI (this message contains SOAP envelope although XI expects to get message without it), and during the mapping step i get "Runtime Exception in Message-Mapping transformatio~".
I suppose it's because i created proxy manually. I did so because when i imported WSDL, and tried to generate proxy in CRM, i got an error message that said that proxy couldn't be generated because external definitions are only allowed in XI 3. But my XI version is 3.0! And when I generate the same proxy in my R/3 system that is installed on WAS 640, it works.
What can I do?
Cheers,
Anya. -
I want to use weblogic's T3Services from within stateless session beans. But when I try to do this I get the following error
java.rmi.RemoteException: java.lang.NoClassDefFoundError: weblogic/common/T3ServicesDef
and when I try to put \weblogic\classes in JAVA_CLASSPATH while starting weblogic the server does not start.
Is their a way of using these services from within EJB's
I am using weblogic 5.1.0 service pack 6 under WINNT environment with SP5
Thanks
SohitYou have classpath problems. Please post the classpath and the weblogic
classpath that you are using to start the server. In particular, make
sure that your ejb-jar is not found in either of these.
-- Rob
Sohit wadhwa wrote:
>
I want to use weblogic's T3Services from within stateless session beans. But when I try to do this I get the following error
java.rmi.RemoteException: java.lang.NoClassDefFoundError: weblogic/common/T3ServicesDef
and when I try to put \weblogic\classes in JAVA_CLASSPATH while starting weblogic the server does not start.
Is their a way of using these services from within EJB's
I am using weblogic 5.1.0 service pack 6 under WINNT environment with SP5
Thanks
Sohit
Maybe you are looking for
-
How can i change my e-mail address from old provider to new
How can I change my e-mail address on my iphone to a new internet provider that I just got. I already went to appleid.apple.com, and then changed to new e-mail there, but for some reason when I pressed the save button, it seemed like it wouldn't wan
-
Hi gurus, My dataflow is like datsource->infosource->wrute optimised DSO with semantic key.. In source , i have 10 records in that 7 records are duplicate records. I reduced the DTP datapackage size from 50000 to 5. When i excuted the DTP , i got 2 d
-
How to restore from time machine for another user login
I use time machine to back my computer which has multiple user login. First I set up time machine backup using User A. I checked that User B files in the hard disk is also backed up, and I can restore using User B login. Then I changed the hard dis
-
ID, IR error when try to login (JNDI error) during SSL configuration
I'm in the process to configure SSL on SAP J2EE Engine. I'm following the document of SAP library and "Enabling SSL and client certificates on SAP J2EE Engine" by Angel Dichev of RIG, SAP Labs. I deployed the SAP Java Cryptographic Toolkit and update
-
Hi All, I have two processes, one creates environement in RW mode, creates a transactional database(s), writes n records, and closes it. Another process opens the same env (by this I means same directory), in RO mode (I understand this gives snapshot