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

Similar Messages

  • How to call web-service using only java code

    Hello, how to call web-service using only java code. I can call it from BPM process or Web Dynpro Java Application, but if I need to call it from ejb component?

    I'm found answer:
    Java and SAP Portal blog: How to call web service from java code example

  • How to set a variable in portal session using web dynpro java.

    Hi,
    I have created a web dynpro application, which is running inside portal. I have created a role called "R1". Inside role R1, i have created 3 workset W1, W2 and W3. and inside each workset i have some pages and iviews.
    My requirement is when user logins to the portal , and when he clicks on role R1 for the first time, a login page should come (so that we can do revalidation), and when he enters his password again in that login page , then only workset W1, W2 and W3 should be visible/accessible to him and after successful revalidation, if he clicks again on role R1, in that particular portal session, than that login page should not come.
    for this, i thought i will set a variable in portal session, whenever user successfully revalidated himself, and if after successful revalidation he clicks again on role R1, i will check in doinit method of webdynpro whether variable is set or not (which i already set on successful revalidation), and if it is set then i will do Donavigation else i will present login page to the user.
    Can anyone tells me how to set a variable in portal session using web dynpro java.
    thanks
    Arush

    Hi,
    Try this:
    WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE, key, value)
    WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE, key)
    Ex:
    WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE,"Key1","Value1");
    String value1=WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE,"Key1").toString();
    /people/william.cui/blog/2007/02/12/sharing-session-context-between-parent-and-external-windows-running-on-same-host
    Regards,
    Charan

  • 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

  • How to call a .jar file from a java bean?

    any body knows how to call a .jar file from a java bean?

    Crosspost!
    http://forum.java.sun.com/thread.jspa?messageID=4349619

  • How to find who is login Portal by using webdynpro with java

    Hi Friend
    One Supplier( Abc) Login into the portal . How to find it "ABC"  user login into portal by using webdynpro with java
    My requirement is
    One Supplier login in to the portal that supper having one Vendor number ( it is fixed)
    Exp: Portal user vijay login his vendor number 12345 like
            Suppose u r login into the portal u have one vendor number like this
    i have to desine one screen that is find PO'Status Screen, In that Screen, Meterial Group,line number,PO Status and Vendor number is avaliable.
    Supplier login in to that portal he is finding some items.
    this my Requirement. i m creating this screen ..How to fined user name from portal .once i have to find this user name by using webdybpro with java. I have to assine vendor number
    Regards
    Vijay

    Hello Vijay,
    You can wirte the following code to get the logged in user's ID
    try {
              IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
              IUser sapUser = wdClientUser.getSAPUser();
              IUserAccount[] acct = sapUser.getUserAccounts();
              String str = acct[0].getDisplayName();
              wdComponentAPI.getMessageManager().reportSuccess("user "+ str);
         } catch (WDUMException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
         } catch (UMException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
    You need security api for using it make sure that is present.
    Thanks,
    Hope this will help
    Sarbjeet

  • 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

  • Expose EJB through Java Bean model importer in Web Dynpro

    Hi,
    I am planning to expose EJB like following:
    1. Create Stateless session bean as a façade for DAO access.
    2. Create DAO to access database. In my case is Oracle DB
    3. Create Java Bean to encapsulate session bean
    4. Import java bean model to web dynpro
    Few of my business method return the object array e.g. Customer[] which contains all properties of customer, and getter, setter.
    Has anyone done this before? Is there any sample code?
    Best Regards,
    Zhang Yan

    Hi
    I think u can refer to the following link
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/java/simple java bean generator for database.pdf
    Thought this link is also Useful
    Creating and Deploying Web Services for an EJB
    Wishes
    Krishna kanth

  • Importing Java Bean Model in Webdynpro Development Component

    Hi All,
    Is there any simple tutorial, example  to import java bean model in webdynpro development component.
    I am using NWDS 7.0 SP14 and WAS 7.0.
    it really helps if you can  provide simple EJB as a development component with details how to create a public part and using this bean as java bean model in Webdynpro development component.
    what are the steps to be followed with precautions
    Thanks in Advance,
    Murali

    Hi,
    [Using the Java Bean Model in Web Dynpro|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4072c0d0-c21e-2b10-ab84-e2c183d355de]
    [Using EJBs in Web Dynpro|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93a5c]
    you will get more if you search in the forum.
    more help on EJB's
    Re: Help needed in EJB
    http://help.sap.com/saphelp_nw70/helpdata/EN/19/f9bc3d8af79633e10000000a11405a/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70929198-0d36-2b10-04b8-84d90fa3df9c
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93a5c
    PradeeP

  • Import Java Bean model in Web dynpro DC

    Hi all,
    I have created the following DC's on a track:
    1. EMPDic (Type: Dictionary) - DC that contains the database table.
    2. EMPEjb (Type J2EE) - DC that contains the EJBs that have business logic. Created a public part EMPpp that containd the bean classes.
    3. EMPEar (Type J2EE) - DC that contains the EMPEjb module.In Used Dcs added EMPpp
    4. EMPCmd (Type: Java) - DC that acts as the command bean.
    Created 2 public parts 'compile'(Type:compilation) and 'deploy' (Type:assembly). In Used DCs added EMPpp.
    5. EMPWd (Type: Webdynpro) - DC that will contain the Java Bean Model and the application. In Used DCs added 'compile' and 'deploy'.
    Q1.) Now when i try to import the Java bean model by selecting the radio button "public parts of used DCs" and look at the dropdown, i am not able to see any of the jar's related to my command bean DC.
    If i select the radio button "project(source folder)" and click Next it says 'No JavaBeans for import'. Am i missing something?
    Q2) Could someone tell me the exact steps from pt. 4 onwards. ie. whether it is necessary to create the 2 public parts for EMPCmd DC and what should it contain.
    Thanking you in advance.

    Hi Melwyn,
    check the NWDI tutorial, it will help you:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c0b53558-6df6-2910-cfbf-a63316bb0fad
    kind regards
    Stefanie

  • How can I include Java Bean model into the model outside the component

    Hi All,
    I am new to SAP portal. I wanted to create a bean for storing the data and to include that into the application model.
    Please help me with an example .
    Regards,
    Saroj

    Hi,
      Check these blogs.
    The specified item was not found.
    Importing Complex JavaBean model into WebDynpro by creating relationships for the model classes
    JavaBean Model Import: when it really works
    Issue in Importing Java Bean Model
    Regards,
    Harini S
    Consider rewarding points for helpful answers. Post this thread in WD forums for more results.

  • Simple Java Bean Model in Wed Dynpro

    Hello All,
    I have to develop a WD Java application with an Oracle DB as the backend. To application was designed to abstract the backend interaction into a Java bean model. The data connection and retrieval was successful. To move the data to the context following steps were performed:
    1. Create a java class with the variables to be used as context in the application. Ex: Name, Subject, Email
    2. On interting the ResultSet, set the values to the variables.
    But, only the last row of data is retained. We tried to use array but have not been able to move the ste of values to the context.
    Request your help in this regard to store the set of values into the context.
    Thank you.

    Hi,
    It looks like you are overwriting the same context element when populating it with the values from the resultset.
    Make sure you create every time a new context element and add it to the context root.
    while (rs.hasNext()) {
        ContextElement elem = new ContextElement();  // or something simular appropiate to your element
        elem.setName(rs.next().getName());
        contextRootNode.addElement(elem);
    Hope this helps a little.
    Regards,
    Alain

  • Diffrence b/w Deploy Time & Design time in Java bean model

    Hi all,
    I have craeted a model using java bean.
    create model->import java bean model->Add JAR->browse the jar.
    There i have got two Radio Buttons
    Design Time
    Deploy Time
    I have worked with this two i have not observed any difference.
    Can anyone give me some idea about this.If possible with an example to?
    Thanks & Regards,
    Lokesh.

    HI Lokesh,
    The basic difference between design time and deploy time is. design time jars are only used when building your aplication and considered to be present already on server. and at runtime application refer to it..
    while if you keep deploy time, then the application itself keeps that jar file with him and at runtime it refers to it.
    i.e. application deploy that jar file on server.
    When you run an application, application need all its dependencied to be present in webdynpro container of server.
    your javabean model needs those jar files at server. so when you chose deploy time. it personly deploy that file on server.
    Iif you keep it as design time then. then you will be  able to build it.
    but if those jar files are not present at the server then your application will not get deployed.
    e.g.
    let A & B are your two applications and they need xx.jar file of a EJB  which is created by you  to create a javabean model.
    now as this xx.jar file is not present at server.
    1. when you create model for A. Keep it as deploy time.
    as application A deploy that xx.jar file on server. B can refer it directly
    2._when you create model for B keep it as design time._

  • Importing java Bean Model

    hai ,
    am new to webdynpro for java ... Am trying to import ejb bean jar to web dynpro ..
    Steps as follows
    i) copy the bean jar to wd project lib folder
    ii) Set classpath
    SampleWD - > Model
    Model -> create model
    Model name  :  Samplemodel
    Model package : com.sample
    Local jar file : C:\sap\workspace\SampleWD\lib\addbean.jar -- getting error in this step as Invalid Class - java bean not available for import
    can anybody help me ..
    Thanks in advance...
    regards,
    Krish

    Hi Krish,
    In addition to Madhu's suggestion,
    As per the Java Bean Model creation steps, you will need to add the Commanad Bean JAR too in your Project, and while creation of Model, you need to select this Command Bean JAR and not the Bean Project JAR.
    Regards,
    Alka.

  • Importing Java Bean Model (Command Bean) with Session Bean

    Hello all,
    I'm trying to import a CommandBean as a Java Bean Model in WebDynpro but I'm prompted with an error indicating that I cannot import the EJB (Session Bean) DC that is being accessed by my CommandBean - hence failing to import the CommandBean DC as well.
    How do I import this?
    Help please.
    -Regards,
    Jan

    HI,
    just add ejb20.jar as an external jar in your WD project.

Maybe you are looking for

  • HELP!!! External eSATA no longer recognized by DVR

    Hi, I am experiencing a problem with my external WD eSATA harddisk. The setop box was recognizing it perfectly and I was recording programs with no problem. Suddenly the DVR does not show the drive any longer. I tried unplugging and rebooting. Did no

  • AirVideo Server and Apple TV?

    I have lots of videos that I have converted to "itunes format" but I have numerous home videos from when I used to be on Windows that won't play in itunes. I know I can convert them but I am running AirVideo Server on my Mac desktop and it allows me

  • External Table Load KUP-04037 Error

    I was asked to repost this here. This was a follow on question to this thread how to load special characters (diacritics) in the Exort/Import/SQL Loader/External Table Forum. I've defined an external table and on my one instance running the WE8MSWIN1

  • Duplication of birthday entries in list

    I have noticed that birthday reminders populate the list of events with an item for every year. For instance, a birthdate in 1928 creates entries in the list for every year from 1928 to 2007. I have set preferences to delete events and tasks 30 days

  • Update VBKD table using open sql

    HI when i use BAPI_SALESORDER_CREATEFROMDAT2 to create SO! but some field i can't fill in BAPI_SALESORDER_CREATEFROMDAT2 of parameter. so i want update it using open SQL. so i want to use BAPI_SALESORDER_CREATEFROMDAT2 first. and next using open sql