How to access Sap portal login user in ejb web service

Hi,
I wnt to access SAP Portal login user in my ejb application which resides on the same server.
I am using following code
try {
     IUser user =null;                         IWDClientUser wdUser = WDClientUser.getCurrentUser();
                              user = wdUser.getSAPUser();
                         } catch (WDUMException e) {
                              // TODO Auto-generated catch block
                              e.printStackTrace();
Some additional jar files are required for this?
The same code works fine with webDynpro but not with ejb.
Thanks in advance     
Best regards,
Nilesh

Thanks for reply.
I have already added com.sap.security.api in my EJB module project classpath. How to add the same in EJB application Project (application-j2ee-engine.xml)?
Best regards,
Nilesh

Similar Messages

  • How to assign Tasks to other users using Exchange Web Service.

    How to assign Tasks to other users using Exchange Web Service.
    Any workaround also would help

    Hi Glen,
    I am trying to use ExtendedPropertyType and put in UpdaterItemType as in this code as below. Although it is not updating the Owner
    field.
    I have tried it both by Propertyname and PropertyID. Although new custom property's canbe
    added but to change an existing one like 'Owner' ? Would this be the right method.
    2. And Is ProprertyID a fixed value as 0x811f or does it need to be calculated.
    3. Is 'Owner' the right propertname for assigning a task ?
    Thanks a lot.
    Please see code below for reference.
     PathToExtendedFieldType pathExtended = new PathToExtendedFieldType();
                //pathExtended.DistinguishedPropertySetId = DistinguishedPropertySetType.PublicStrings;
                pathExtended.DistinguishedPropertySetId = DistinguishedPropertySetType.Task;
                pathExtended.DistinguishedPropertySetIdSpecified = true;
                pathExtended.PropertyId = 0x811f;
                pathExtended.PropertyIdSpecified = true;
                //pathExtended.PropertyName = "Owner";
                pathExtended.PropertyType = MapiPropertyTypeType.String;
                ciSetAT.ExtendedProperty = new ExtendedPropertyType[1];
                ciSetAT.ExtendedProperty[0] = new ExtendedPropertyType();
                ciSetAT.ExtendedProperty[0].ExtendedFieldURI = pathExtended;
                ciSetAT.ExtendedProperty[0].Item = "[email protected]";
                SetItemFieldType set1 = new SetItemFieldType();
                set1.Item = pathExtended;
                set1.Item1 = ciSetAT;
                UpdateItemType request = new UpdateItemType();
                request.ItemChanges = new ItemChangeType[1] { new ItemChangeType() };
                request.ItemChanges[0].Item = itemId;
                request.ItemChanges[0].Updates = new ItemChangeDescriptionType[2];
                request.ItemChanges[0].Updates[0] = setstart;
                request.ItemChanges[0].Updates[1] = set1;

  • How to access  complex data type from a soap web services?

    hello
    can u please tell me how can i access complex data type from a soap web service from jdeveloper 10g
    Jdeveloper generates 3 classes
    serviceStub
    getproperties
    response
    i have to retreview the data which is a complex data type it gives some
    unknown type. and the return value is a key-value pair data type .
    regards
    vs

    After you create the partner link and the invoke (to create the variables), change the element type of the response message to the complex type definition of your collection that appears in the XSD. You can do the same thing if you want to change the element type of the payload of the request message as well.

  • How-to access username and password protected Java EE Web services from ADF

    The title of this post is exactly the same as this article by Frank Nimphius:
    http://www.oracle.com/technology/products/jdev/howtos/1013/protectedws/access_protected_web_services_from_adf.htm
    The article addresses the problem of securing web services using usernames and passwords, when those web services are accessed through a proxy or a data control. In the examples, the user names and passwords are specified, whether in the code or the definition of data controls. (SKING/SKING).
    In a very common scenario, users login to reach a page, for example, A.jspx, which contains a button that calls a web service, for example displayDate. Suppose that user has logged in by username/pass of (AHUNOLD/AHUNOLD) and AHUNOLD has access to the service and the page. Is there any way to pass the logged in user name and password to the webservice ? Of course we can hard-code the username in the data control definition or proxy code, but this is just one of the thousands of users who have access to the service and the authentication is not dynamic this way.
    Hope my question is clear. Wishing you all a great Christmas.
    Farbod

    Hi Frank, and happy new year.
    Are you implying that it couldn't be done declaratively? What is your suggestion for this problem? You know the problem... As I described:
    - I need to secure my web services, so when exposed, no one from inside network or the internet, can access the web service without proper permission
    - The web services are shown as web controls on jspx pages. The user has logged in before reaching the page. It is irrelevant to ask him to enter user name and password again.
    - I have user names, passwords and roles in Oracle Internet Directory (Identity Management). It provides some APIs and I can retrieve the usernames and attempt logging in programmically. But how can I get username and password from the session in ADF application?
    I guess using SAML or certificate could be the solution, but I have a problem with SAML, described here:
    Re: Webservices Security, SAML, and Identity Management (OID)
    Best Regards,
    Farbod

  • How to access custom exception in client side in web services?

    I have an interface and implementation of a java web services. One method in it throws a custom exception indicating the error type (authrization fails, db connection lost, etc...). But in the generated proxy file, the catched exception for the correspondent method becames java.lang.Exception. I check the code and found the actual thrown exception is com.apache.soap.SOAPExcetion. In the client code, I printed out all the SOAPExcetion and related Fault messages but could not find my original custom exception info. I need this custom exception to be accessed to the client so the client knows what's wrong.

    for current user, SPGroup.ContainsCurrentUser
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spgroup.containscurrentuser.aspx
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • How do I get Portal Login User Details in WD Application

    Hi,
    Could you please help me out as how to get the user who has logged into the portal.
    Regards,
    Abilash.

    Hi,
    In you webdynpro location you can use the following code to get the logged in user details.
    String strUserName = null;
    try {
    IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
    IUser sapUser = wdClientUser.getSAPUser();
    if (sapUser != null) {
    IUserAccount[] acct = sapUser.getUserAccounts();
    if (acct[0] != null) {
    strUserName = acct[0].getDisplayName();
    } catch (WDUMException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    } catch (UMException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    The following import statements have to be used
    import com.sap.security.api.IUser;
    import com.sap.security.api.IUserAccount;
    import com.sap.security.api.UMException;
    import com.sap.tc.webdynpro.services.sal.um.api.IWDClientUser;
    import com.sap.tc.webdynpro.services.sal.um.api.WDClientUser;
    import com.sap.tc.webdynpro.services.sal.um.api.WDUMException;
    Award points if helpful.
    Regards,
    Sujana

  • How to disable right click on SAP portal login page

    Hi,
    How to disable right click on SAP portal login page. Our requirement is one should not be able to right click -
    >view source. on the portal login page.
    Best Regars,
    Tushar

    Hi Tchanvan,
    If you search google with "javascript disable right click" you will get loads of javascript code. This will also help you to gain knowledge.
    @Explanation to last post : You need to import standard logon par file in NWDS. Create javascript file to disable right click and then include this file in your logon page. i think login page name is portalLogin.jsp and then deploy this new PAR file.
    regards,
    Jigar Oza

  • How to access the portal database ?

    Hi ,
    1. How to access the portal database from an abstract portal component program ?
    2. How to insert data to the Table from the abstract portal component program ?
    Please provide me some direction to proceed .
    plz send me the steps how to access the Database using SQL.
    Thanks
    Smita
    Edited by: Smita Mohanty on Nov 14, 2008 9:21 AM

    Hi Smita,
    In case your portal has MS SQL server as its databse, then I am giving the step by step directions to achieve 90% of what you wish to do. Rest 10% you can try on your own.
    Go through my article given below:
    [How to Create a Web Service using Enterprise JavaBeans|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/b00917dc-ead4-2910-3ebb-b0a63e49ef10]
    First go through pages 1-12 which will help you to create user/table in MS SQL database as well as create a data source in Visual Admin. Page 19 will give you the code which you can use in your Portal component to access the tables you have created in your SQL database.
    I hope your problem gets solved.
    Bye
    Ankur

  • Dynamic Text in SAP portal login page

    Hi All,
    I want to display some text information in the SAP Portal login page.Is it possible to display dynamic text in the login page?
    Can anybody help in this?
    Regards,
    V Karthi

    Check the following links as well.
    [Customizing Portal Login Page;
    [Portal Login Page Customization;
    Check all 3 weblogs.
    Regards
    Puneet

  • Accessing sap tables data and display in webi

    Hi all,
    i installed business objects edge series.
    i want to access SAP tables data and display in webi for adhoc reporting.
    Is there any process to achieve this.

    Hi
    currently (April 2010) you have the following options:
    1. You load your R/3 data into an SAP BW and use universes based on BEx queries to create WebI reports
    2. You can use SAP rapid marts. They contain Data integrator mappings (you need an installation of the DI for this) to extract and load your SAP R/3 data into a relational database. Additionally they provide universes (based on a relational schema) hich ill allo you to build WebI reports.
    3. You can use the R/3 connector for the Data Federator (You need a DF installation for this). Please note that the R/3 connector is not yet a product rather just a PROTOTYPE. Take a look here: SAP BusinessObjects Web Intelligence Reporting for SAP ERP [original link is broken]
    4. You can try to access the underlying database directly using the appropriate DB drivers. Please note that this is NOT RECOMMENDED. This way you cannot leverage security defined on the R/3 side in your WebI reports and you will not be able to access all data as available in R/3 since some of them are stored encoded/compressed in the underlying tables.
    5. Instead of WebI you can use Crystal Reports and the R/3 drivers (eg. SAP Tables, Functions, Cluster) provided when installing the integration kit for SAP.
    Regards,
    Stratos

  • How to Access the value(Ex: Delivery no) From Web to R/3 side.

    How to Access the value(Ex: Delivery no) From Web to R/3 side.
    Any sample code please suggest.
    sai

    Hi,
    Try RSA3.
    Extract Checker
    /people/sajeed.ms/blog/2006/02/12/extract-checker
    Thanks,
    JituK

  • How to use a deployable proxy to consume a web service?

    HI Gurus,
    I am following this article below which helpfully explains how to create a proxy. So far so good. I have been able to create a proxy. However, the article only describes how to build a proxy.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70c7d0f7-153d-2a10-5d96-d334b67cd771
    In the concluding part of the document the author says "In my next article I will tell you how to use this deployable proxy to consume the web service in web application."
    I have looked around the SDN but have not been able to get the next part of this document.
    I have a JSPDynpage application which is required to consume a webservice. I want to use this proxt to consume the webservice.
    Any help or any other document that explains how to use a deployable proxy to consume a web service will be helpful.
    Thanks,
    SB

    Hi,
    Here is an example how to consume the deployable proxy in web application:
    http://help.sap.com/saphelp_nw70/helpdata/EN/ca/c8efe3e8a64163b01924ad4ccd706d/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/EN/5c/971740198d8f5ce10000000a155106/frameset.htm
    Regards,
    Praveen Gudapati

  • How do we call smartforms in abap program or web services

    how do we call smartforms in abap program or web services
    How many types of smartforms are there?
    points will be rewarded

    Hi
    See this sample program
    Using the fun module smartform is called from the program
    Calling SMARTFORMS from your ABAP program
    REPORT ZSMARTFORM.
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    http://sapr3.tripod.com
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
    INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
    MOVE-CORRESPONDING MKPF TO INT_MKPF.
    APPEND INT_MKPF.
    ENDSELECT.
    At the end of your program.
    Passing data to SMARTFORMS
    <b>call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZSMARTFORM'</b>
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    FM_NAME = FM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    if sy-subrc <> 0.
    WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function <b>FM_NAME</b>
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    TABLES
    GS_MKPF = INT_MKPF
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5.
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • How to add image in ejb web service

    Hello Community,
    I am writing web service to create a PDF file using itext API. In PDF file i want to add an image.
    Can someone please tell that , how can i add image(jpeg, png , etc.) to an ejb web service?
    Thanks in advance
    Regards,
    Dishant Chawla

    Hi,
    Please check the below code which i used to add image to the header using iText . Similarly you can add image directly to the document also as a element.
    Adding image as Header:
    httpServletRequest = request.getServletRequest();
    domainURL=httpServletRequest.getScheme()+"://"+httpServletRequest.getServerName();
    imgLogo=domainURL+request.getWebResourcePath()+"/images/XXXX.jpg";
    image =Image.getInstance(imgLogo);
    image.scalePercent(22);// As per you need
    chunk = new Chunk(image, 0, -20);
    HeaderFooter header_pdf = new HeaderFooter(new Phrase(chunk), false); // here i have added image as header
    header_pdf.disableBorderSide(0);
    header_pdf.setAlignment(Element.ALIGN_CENTER);
    header_pdf.setBorder(0);
    document.setHeader(header_pdf);
    (or)
    Adding Image a Element:
    httpServletRequest = request.getServletRequest();
    domainURL=httpServletRequest.getScheme()+"://"+httpServletRequest.getServerName();
    imgLogo=domainURL+request.getWebResourcePath()+"/images/XXXX.jpg";
    image =Image.getInstance(imgLogo);
    image.scalePercent(22);
    document.add(image);
    Java IText: Image | tutorials.jenkov.com
    Regards,
    Srinivasan V

  • How to access a Portal User Info from a J2EE application?

    Hi,
    I have deployed a j2ee application in portal and its running fine.
    from that application i need to assign some roles to some users.i have the user id.
    so my doubt is can i access the portal user info from this j2ee application?i have some servlets in the j2ee application....can i get the portal user info from this servlet?
    plz help me
    regards,
    Visweswar

    Hi,
    Please check out this to get the portal user information from Java -
    WdClientUser class/Interface to aciehve this.
    Please check out these links on the same -
    WDClientUser.getClientUser IUser
    help needed
    Regards
    Lekha

Maybe you are looking for

  • File Links in PDF getting messed up when viewed in browser

    When we put a file link in a PDF (\\servername\sharename\directory\file.doc) and display that PDF in a browser, when we click on that link, it becomes http://webname/servername/sharename/directory/file.doc which does not work at all. I have tried the

  • Loss of Synchronization for Finite Pulse Train generation

    I have successfully generated a finite pulse train on my 6608. My program is based off an example I got from NI Zone (Square_Wave_Trigger.zip). Unfortunately, the Finite Pulse Train loses synchronization every once in a while, and I'm not sure why. I

  • Will the e-seminar on FrameMaker scripting ever be available again?

    I'm referring specifically to the one listed in the ExtendScript Resources section. I'd also be interested in any other videos out there that could help me learn the basics of FM scripting. Any info would be much appreciated!

  • DSL Internet service

    I've been trying to order DSL from Verizon, for over a month. Everytime they put in my order--it gets cancelled. I tried to contact the tech support, provision, billing, sales dept. to find out what is going on! They were giving me the same answer, t

  • Unable to install new Exchange server

    Hello all, The basics of this is that I had an exchange 2007 server install that went wrong and now there is an additional exchange server in ADSI edit.  I have brought in a completely new server and gave it the same name.  When I go to install excha