EJB call Portal Service

Hi everyone,
I created a portal service and deployed it to the J2EE server.
I also created an EJB and deployed it on the same J2EE server.
Is it possible that the EJB can use the Portal Service ?
Thanks.

David,
Actually, I just found a document that might be helpful. Please check if <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/42/9ddd0cbb211d72e10000000a1553f6/frameset.htm">this</a> fits into your scenario.
Best regards,
Vladimir

Similar Messages

  • 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 Motl

    Hi Josef,
    Is the IJCOClientService located on the producer side or on the consumer side?
    Amit

  • 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 Portal Service using result as Java Bean Model impossible?

    Hello folks,
    we try to achieve to call a portal service (working) which gives as a result a list of object of type com.foo.Report. We want to make use of this class as a model class, so we have the class as a model node in the context. The class itself is part of the service DC.
    Unfortunately at run time it gives us a NoClassDefFound Exception of com.foo.Report.
    As the com.foo.Report is part of the same DC as the service, it is no option to add the PAR public part to the used DCs of the WD DC because then there is this type conflict when we call the service (service look up). Or am I wrong and this is the way to do it? I mean I struggled quite a while to get the service look up right and needed to remove all the PAR/lib used DCs from the used DCs of the WD Project, when I got it working this Model error came up. I also tried to put the Model class in a separate DC but that caused the same error.
    how is it possible to call a Portal service from WD and using it's return vale as a Model class
    our system iis 7.0.17
    best
    Stefan

    Hi,
    Refers the following docs..
    EJBs in Web Dynpro Application Using Wrapper Class
    Here Java Bean Model used in web dynpro.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00be903b-8551-2b10-c28a-8520400c6451
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93a5c
    Accessing database table using EJB and web dynpro
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70929198-0d36-2b10-04b8-84d90fa3df9c
    Oracle Connectivity with EJB using WebDynpro Application
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/oracle%2bconnectivity%2bwith%2bejb%2busing%2bwebdynpro%2bapplication
    Hope it will help u.
    thanks
    Abhilasha

  • Calling portal service ?

    Hi,
    am trying to call a portal service from portal application.
    2 scenarios:
    SCENARIO 1:
    componnent and the service in the same project.
      in the KEY filed of ImyService. when I provide the value as Parfilename|servicename, it works
    when i change the KEY field to name of the classfile, i.e. com.mycomp.myService [ implemention class of that interface], it doesnt work. throwing exception "could not instatiate the implementation class".
    SCENARIO 2:
      SERVICE and the usage component is in different projects and I provided the value of service to sharingreference in the portalapp.xml file
    it doesnt work when the KEY is  "Parfilename|servicename" or when it is set to the class file name, i.e. "com.mycomp.myService".
    BTW, the portal service is started.
    any ideas are highly appreciated.

    Hi Yogi,
    The Steps below Describes how to call a Portal Service from a Portal Application.
    <b>Add Sharing Reference Value in the Deployment Descriptor.</b>
    <application-config>
            <property name=”SharingReference” value=”<ApplicationName or ApplicationAlias>”/>
            <property name=”SharingReference” value=”com.sap.portal.navigation.api_service”/>      
    </application-config>
    <b>Add Libraries of the Portal Service (xxxapi.jar)</b>
    <b>Write code to access the Portal Service</b>
    Import Package of the Portal Service
    Get Instance of the Portal Service
    Call Methos of the Portal Service.
    <b>Here is an Example:</b>
    <b>PORTAL SERVICE</b>
    /********************** Service Interface : IServiceOne.java ************************/
    package com.abc.def;
    import com.sapportals.portal.prt.service.IService;
    public interface IServiceOne extends IService
        public static final String KEY = "ServiceProject.ServiceOne";                         
                                          //PARFilename.Servicename
        public String display();
    /**************** Service Source File : ServiceOne.java  ***************************/
    // Implement the display() Method
    public String display() {
         // TODO Auto-generated method stub
         return "Welocme To My Service Project. Thank you for accessing my service.";
    /*******************portalapp.xml*********************/
    <application>
      <application-config/>
      <components/>
      <services>
        <service name="ServiceOne">
          <service-config>
            <property name="className" value="com.abc.def.ServiceOne"/>
          </service-config>
        </service>
      </services>
    </application>
    <b>After Creating Your Service , Deploy it on the Server.</b>
    <b>PORTAL APPLICATION</b>
    package com.sample;
    import com.abc.def.*;
    import com.sapportals.portal.prt.component.*;
    import com.sapportals.portal.prt.runtime.*;
    public class AccessOne extends AbstractPortalComponent
        public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
              IServiceOne myService =(IServiceOne)PortalRuntime.getRuntimeResources().getService(IServiceOne.KEY);
             String s = myService.display();
             response.write(s);
    /********************** Portalapp.xml ***********************/
    <application>
      <application-config>
        <property name="SharingReference" value="ServiceProject"/>
      </application-config>
      <components>
        <component name="AccessOne">
          <component-config>
            <property name="ClassName" value="com.sample.AccessOne"/>
          </component-config>
          <component-profile/>
        </component>
      </components>
      <services/>
    </application>
    <b>Right Click on the Portal Application --->Properties -> Java Build Path-> click on Libraries Tab on the Top and Click Add External Jars Tab on the Right ---> Add Your Portal Service PAR File</b> .
    Now Deploy the Application.<i></i><u></u><i></i>
    Reward Points if u find this useful.
    Regards,
    Eben.

  • 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 PM

    Hi
    You can call the IPortalService API as in this [thread|how to call a portal service;
    Regards
    johann

  • EJB calling SOAP service

    I'm experiencing a problem on 61.sp3.
    I have an EJB that utilizes an API toolkit to access SOAP services on a
    Tomcat server. The SOAP service sends back a SOAP exception which is
    correct in what I am asking
    in to do. However, the weblogic app server is returning a SOAP
    exception to my EJB rather than passing the SOAP exception to the API
    toolkit that I am using to make my SOAP calls.
    Has anyone seen something like this?
    Sandy Mustard

    I did it (wsdl2java).
    But I am working with jaxrpc.jar and axis.jar.
    What my EJB does is:
    java.xl.rpcCall call;
    try {
        java.xl.rpc.ServiceFactory serviceFactory = java.xl.rpcServiceFactory.newInstance();
        Service service = serviceFactory.createService(new QName("", "hello"));
        QName qName = new QName("http://www.w3.org/2001/XMLSchema", "Array");
        TypeMapping service.getTypeMappingRegistry().getDefaultTypeMapping();
        typeMapping.register(ArrayList.class, qName,
                            new ArraySerializerFactory(),
                            new ArrayDeserializerFactory());
        call = service.createCall();
        } catch (ServiceException e) {
            cat.error(e.printStackTrace());
        try {
            call.setTargetEndpointAddress("http:/localhost:81");
        } catch (JAXRPCException e) {
            cat.error(e.printStackTrace());
        call.setProperty(Call.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE);
        call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
        call.setOperationName(new QName("", "hello"));
        try {
            return call.invoke(new Object[]{});
        } catch (RemoteException e1) {
            cat.error(e.printStackTrace());
        }Now I have another error which varies, it's quite disturbing me.
    It goes from 'NoClassDefFound' to 'Linkage' errors...
    Unexpected Error:
    java.lang.NoClassDefFoundError: javax/xml/rpc/encoding/TypeMapping
    and
    Unexpected Error:
    java.lang.LinkageError: loader constraints violated when linking javax/xml/rpc/encoding/SerializerFactory class
    I get similar errors if I force the serviceFactory to be an instance of org.apache.axis.client.ServiceFactory.
    Apparently I cannot make such remote calls within an only thread (?)
    GNeidisch

  • 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

  • How do i call web services from SAP ABAP

    Hello,
    Ian working with .net team. they are using sap .net Connector to connect SAP. But my job is In SAP side when Purchase Requisition is created, I have to call web services from ABAP and i have to pass the Purchase Requisition number to web service(.net Program). Please help me how to call web services from ABAP and how to pass value. Any one help me with example.
    Thanks
    RaviKumar

    Hi Ravi,
    If you can call EJB from ABAP and from EJB call Web service which you want to call. I am giving code to write in EJB business method processFunction.
    public void processFunction(Function function) {
       IRepository repository;
       repository = new Repository("TestRepository");
       JCO.MetaData fmeta = new JCO.MetaData("ZTEST_EJB");
       fmeta.addInfo("REQUTEXT", JCO.TYPE_CHAR, 255,   0,  0,  
       JCO.IMPORT_PARAMETER, null);
       fmeta.addInfo("ECHOTEXT", JCO.TYPE_CHAR, 255,   0,  0,
       JCO.EXPORT_PARAMETER, null);
       fmeta.addInfo("RESPTEXT", JCO.TYPE_CHAR, 255,   0,  0,
       JCO.EXPORT_PARAMETER, null);
       repository.addFunctionInterfaceToCache(fmeta);
       JCO.ParameterList input  =
       function.getImportParameterList();
       JCO.ParameterList output =
       function.getExportParameterList();          
       JCO.ParameterList tables =
       function.getTableParameterList();
      if (function.getName().equals("ZTEST_EJB")) {
                        output.setValue(input.getCharArray("REQUTEXT"),"ECHOTEXT");
    output.setValue("This is a response " + table.getString("E_NAME") +" " + output.getName(1), "RESPTEXT");
      else if (function.getName().equals("STFC_STRUCTURE")) {
      JCO.Structure sin  = input.getStructure("IMPORTSTRUCT");
      JCO.Structure sout = (JCO.Structure)sin.clone();
      try {
          System.out.println(sin);
       catch (Exception ex) {
           System.out.println(ex);
                        output.setValue(sout,"ECHOSTRUCT");
    output.setValue("This is a response from Example5.java","RESPTEXT");
    }//if
    Here REQUTEXT, ECHOTEXT are import parameter and RESPTEXT is the Export parameter of Function module ZTEST_EJB in SAP.
    Here from this bisuness method you can call web service which you want and give back the result of webservice to ABAP F.M.
    Regards,
    Bhavik

  • RFC Call to Portal Service

    Hi
    I am trying to call a Portal Service from the SAP R/3 through RFC.
    I have done the following.
    1. Created RFC in the SAP R/3.
    2. Created RFC Destination in SAP R/3 and WAS 640
    3. Created a Portal Service and deployed in the Portal.
    The problem is when I execute the RFC in ABAP it is giving me this error.
    com.sap.engine.services.ejb.exceptions.BaseRemoteException: Exception in method processFunction
    As anyone faced similar problems, please let me know.
    Regards
    Senthil

    Hi Senthil,
    If you haven't already done so, I think you should try this question in the 'ABAP Programming' forum.
    Yoav.

  • 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, TestPortalService

    Question: 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.

  • Start Portal Service from EJB

    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
    Christoph

    Hi,
    Take a look at this similar post: /thread/412823 [original link is broken]
    BRgds,
    Simon

  • How to call session EJB from EP service in EP 7.0?

    Hi,
    I am trying to invoke stateless session EJB from my portal service. Both the service and EJB are deployed on the same server which is EP 7.0.
    I found [this|http://help.sap.com/saphelp_nw70/helpdata/EN/42/9ddcc9bb211d72e10000000a1553f6/frameset.htm] in SAP help and tried to implement it (added PrivateSharingReference to portalapp.xml and implemented the code), but everytime I try to lookup the session bean and cast it using P4ObjectBroker.narrow() method, I get java.lang.ClassCastException. The object found in JNDI and my portal service have different classloaders, so I suppose this is the problem, but I don't know how to handle it...
    Can anyone please help me?
    Regards,
    Tomas

    Hi Satya ,
              please go though following blog for used DC concept.
    Componentization of Webdynpro Application in CE7.1
    In netweaver 7.1 interface controler is abstract and component controller is implementing interface controller so the context data and methods have to be implemented by component controller

  • Blank SOAP Action in Soap Request- Portal Service calling Web Service

    Hi
    I'm trying to access an Web Service through a client portal service which was generated by NWDS. I called this service from a basic component and tried to execute the WS function after populating all the needed fields. When I started the component I encountered the following error.
    java.lang.IllegalArgumentException: The SOAP Action "" include in the soap request not corresponding to the Portal service method..
    I initially thought it was because I was downloading the WSDL to my local and using that in the portal service generation. Maybe not all the information about the web service was being obtained. I tried it again after generating the portal service from the WSDL online but still obtained the same error.
    Any insight on what's causing the error would be appreciated. Thanks!

    Dear expert.
    i got the same problem with Reyes. anyone can solve this issue?
    thank in advance.

  • DB access in Web Dynpro Portal Service / or EJB with WebService ?

    Hi,
    I will develop a web dynpro application which will run in the EP and use an DB. How are the best practices in this scenario ? Should I use a Web Dynpro Model (EJB or WebService) for the persistence operations or should I use Portal Services ?
    Regards
    Flo

    Thanks,
    ok some words more... , I want to find out the differences between VC, PDK and Web Dynpro. Most of the parts of the application will be written in Web Dynpro. It´s possible to access portal services in Web Dynpro. But not with a Web Dynpro Model, so will going to use EJB/Webservice.
    But here I have one more question... I am wondering why EJB a n d Webservice in combination !?!? Can´t I only write a Webservice o r a EJB to achieve the DB connectivity ?
    Thanks
    Flo

Maybe you are looking for

  • Two hard drives connected to Airport Extreme. How to include one of them in TimeMachine Backup and use other disc as Time Machine backup disc?

    Hi, the title says it all. I've got an airport extreme and two hard drives connected to it. My idea was to use one as my additional storage (say DISC STORAGE) and the other one as my backup drive (say DISC BACKUP). I would like to backup my mac AND D

  • Problem opening workbook with parameter LOV

    hi, i have created a parameter LOV that contains a huge amount of data. i have set the query timing in discov admin as well as desktop so that it comes fine there. but when i try to open the LOV page in the workbook in viewer its giving me the error

  • Using named anchors

    Hi everybody, Let's say I have a two column layout with a series of links inside the left column (sidebar). Is it recommended to use named anchors to link text in one DIV to text inside another? Can I create a menu inside the sidebar and then target

  • Firefox doesn't display Google fonts on parts of my site

    I'm creating a website, using Joomla 3. My template uses Google Fonts (Roboto & Roboto Condensed). On Headers and Paragraphs the font is shown correctly, but not on my TopMenu (and submenus). Why is that? How can I fix this? Here's a link: http://s56

  • Graphic problem in Windows with Boot Camp?

    I only just noticed this today when I was editing some pictures in Photoshop using Windows (Boot Camp). My version is Windows 8 64-bit and the Photoshop is CS 6 but I suspect the same thing would happen even if I were using Windows 7. Whenever I view