Anonymous access to KM documents in WebDynpro applications

I am linking to KM documents in WebDynpro applications. This works fine for normal logged on users, but for anonymous users I am asked to login and gets eventually a "401 Unauthorized" error. I have configured everything according to note 837898 and it works fine for KM Document iViews, but not for WebDynpro iViews that are including KM documents.
What do I have to do?
Regards
/Oskar

Hi Oskar,
when does the authentication request comes up? Directly when you open the WebDynpro iView or only after you try to open the KM document?
In first case the Authentication Scheme for the iView must be set to Anonymous, so that opening the iview via URL ../irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fmy_pcdfolder!2fmy_iview should work fine without authentication.
In the second case you need to make sure that the short km URLs are used as mentioned above and also the Authentication Scheme for the KM Document iView from the Hidden workset in the eu_role set to Anonymous as described in SAP Note 837898.
If you still experience problems you can send me some screenshots.
Hope this helps,
Robert

Similar Messages

  • Accessing Km document in webdynpro application

    Hi All,
    Is it possible to access the file which is uploaded in KM through webdynpro code?
    Can anybody help in this?
    Regards,
    V Karthi

    Thank you anagha for the link.
    But i'm facing some issue with the code .i think there is a problem in typecasting the Iuser and moreover whn i try to print the sap user i'm getting the following error.
    "sapUser Transient data: *************************************************************************** * com.sap.security.core.persistence.imp.PrincipalDatabag Tue Jun 23 10:13:29 GMT05:30 2009 * UniqueID: USER.R3_DATASOURCE.J2EE_GUEST * Type: USER * Home data source: R3_DATASOURCE * Private id part: J2EE_GUEST * * Existence not checked. * * "com.sap.security.core.usermanagement"|->"j_authscheme" (no time limit)="anonymous" *************************************************************************** Persistent data: *************************************************************************** * com.sap.security.core.persistence.imp.PrincipalDatabag Tue Jun 23 10:13:29 GMT05:30 2009 * UniqueID: USER.R3_DATASOURCE.J2EE_GUEST * Type: USER * Home data source: R3_DATASOURCE * Private id part: J2EE_GUEST * * Principal exists. * * Direct parents: * GRUP: GRUP.SUPER_GROUPS_DATASOURCE.EVERYONE *       GRUP.R3_ROLE_DS.SAP_J2EE_GUEST *       GRUP.SUPER_GROUPS_DATASOURCE.Anonymous Users * ROLE: * "com.sap.portal.dsm"|->"DebugControlFlag" (no time limit)= * "com.sap.security.core.usermanagement"|->"mobile" (no time limit)= * "com.sap.security.core.usermanagement"|->"uniquename" (no time limit)="J2EE_GUEST" * "com.sap.security.core.usermanagement"|->"title" (no time limit)= * "com.sap.security.core.usermanagement"|->"telephone" (no time limit)= * "com.sap.security.core.usermanagement"|->"salutation" (no time limit)= * "com.sap.security.core.usermanagement"|->"jobtitle" (no time limit)= * "com.sap.security.core.usermanagement"|->"fax" (no time limit)= * "com.sap.security.core.usermanagement"|->"department" (no time limit)= * "com.sap.security.core.usermanagement"|->"lastname" (no time limit)="J2EE_GUEST" * "com.sap.security.core.usermanagement"|->"locale" (no time limit)= * "com.sap.security.core.usermanagement"|->"timezone" (no time limit)= * "com.sap.security.core.usermanagement"|->"firstname" (no time limit)= * "com.sap.security.core.usermanagement"|->"email" (no time limit)= * "com.sap.security.core.usermanagement"|->"referenceuser" (no time limit)= * "$serviceUser$"|->"SERVICEUSER_ATTRIBUTE" (no time limit)= * "com.sapportals.portal.navigation"|->"uipmode" (no time limit)= *************************************************************************** ep5User WPUser default_namespace: com.sap.security.core.usermanagement [email protected]f WPUser: (J2EE_GUEST)[[email protected]271] UME user object Transient data: *************************************************************************** * com.sap.security.core.persistence.imp.PrincipalDatabag Tue Jun 23 10:13:29 GMT+05:30 2009 * UniqueID: USER.R3_DATASOURCE.J2EE_GUEST * Type: USER * Home data source: R3_DATASOURCE * Private id part: J2EE_GUEST * * Existence not checked. * * "com.sap.security.core.usermanagement"|->"j_authscheme" (no time limit)="anonymous" "
    Can you please provide me the sample code for accessing the KM document through webdynpro?
    Regards,
    V Karthi

  • How to grant anonymous access on sharepoint document library/list only not for web application

    Hello
    How to grant anonymous access on sharepoint document library/list only not for web application.I have claim based sharepoint site and has to be but i want to grant access on document library/list only.Is this possible?
    Thanks
    Rajesh Kumar "Changing the Face" can change nothing.But "Facing the Change" can change everything.

    As i am using following code
    SPSite site = SPContext.Current.Site;
                SPWeb web = SPContext.Current.Web;
                SPSecurity.RunWithElevatedPrivileges(delegate()
                    using (SPSite ospSite = new SPSite(site.ID))
                        using (SPWeb webs = ospSite.OpenWeb(web.ID))
                            // Enable anonymous access on web application
                            webs.AllowUnsafeUpdates = true;
                            SPUrlZone urlZone = SPUrlZone.Default;
                            SPWebApplication specifiedWebApplication = ospSite.WebApplication;
                            SPIisSettings iisSettings = specifiedWebApplication.IisSettings[urlZone];
                            //iisSettings.AuthenticationMode = AuthenticationMode.Windows;
                            iisSettings.AllowAnonymous = true;                       
                            specifiedWebApplication.Update();
                            // Get document library collection here and fetch all the document urls
                            SPDocumentLibrary docLib = (SPDocumentLibrary)web.Lists["Documents"];
                            if (docLib != null)
                                docLib.BreakRoleInheritance(true, false);
                                docLib.AllowEveryoneViewItems = true;
                                docLib.AnonymousPermMask64 = SPBasePermissions.ViewPages | SPBasePermissions.OpenItems | SPBasePermissions.ViewVersions
                                    | SPBasePermissions.Open | SPBasePermissions.UseClientIntegration | SPBasePermissions.ViewFormPages | SPBasePermissions.ViewListItems;
                                //docLib.AnonymousPermMask64 = SPBasePermissions.EmptyMask;
                                docLib.Update();
    Should working but getting access denied......i am totally stuck at this point.
    Rajesh Kumar "Changing the Face" can change nothing.But "Facing the Change" can change everything.

  • Saving a document using webdynpro application

    Dear All,
    I am new in webdynpro development and I have a requirement to develop a webdynpro application which can save a document in a specified file directory. Can somebody please suggest or give sample code as to how to develope this application ...so that i can understand how to go about it.
    Awaiting response.
    Thank You.
    Ranu

    Dear Suresh,
    Thank you very much for your helpful answer.I have rectified the imports. Now the only error that is still persistent is "fname cannot be resolved ".
    I am attaching the code snippet that I have written in the part onActionSave for your perusal.Can you please look into it and let me know where I am making a mistake.
    public void onActionSave(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionSave(ServerEvent)
              byte imgsource[] = wdContext.currentDataElement().getDocument();
              String filePath = wdContext.currentDataElement().getFileName();
              byte[] fileBytes; //an array of bytes
              try {
                   File files = new File(filePath);
                   fname = files.getName();
                   final InitialContext ctx1 = new InitialContext();
                   final DestinationService dstService1 = (DestinationService)ctx1.lookup(DestinationService.JNDI_KEY);
                   final Destination destination1 = dstService1.getDestination("HTTP", "document");
                   //specify the Http destination as document
                   fileBytes = imgsource; //create a byte array from contents of field
                   String docuurl = "http://impp11.pune.telco.co.in:50000/irj/portal/+fname";
                   OutputStream targetFile = new FileOutputStream(docuurl);
                   //define the output stream
                   targetFile.write(fileBytes); //write the array of bytes to file
                   targetFile.close(); //close the File stream
              } catch (Exception e) {
                   e.printStackTrace();
                   wdComponentAPI.getMessageManager().reportSuccess(e.getMessage());
    Thank You.
    Ranu

  • Appraisal documents with Webdynpro application

    Hi All,
    in my system i can see some of the webdynpro application for appraisals
    e.g.
    HAP_START_PAGE_UI  with application hap_a_ess_start_page
    HAP_DOCUMENT_LINK with application hap_document_link
    etc..
    but when i am trying to run the application i am getting the error message
    Error when inserting or changing in a sorted table
    I have already created the appraisal template and all and those are running with the hap_document_pa BSP application.
    I just have the requirement of look and feel changes so i want to check this out.
    Regards,
    Umesh Chaudhari.

    Hi,
    An objective setting cycle encompasses the following phases:
    Planning
    In a planning consultation, the necessary qualifications and competencies are first identified for an employee and then concrete objectives and required performance levels are agreed. For example, sales targets could be defined and the employee could agree to take on specific tasks in a project, and so on. These aspects can be defined by the manager, by the employee or both. The employeeu2019s personal training and development requirements are discussed and entered in the objective setting agreement.
    Review
    During the review, the objectives agreed with the employee during the planning phase are checked and adjusted to reflect the current situation. The manager and employee discuss the possible need for support, establish whether the objectives defined in the planning phase are still relevant, and add further objectives or decide to delete obsolete ones. Furthermore, the manager can make comparisons between the objectives set previously and the employeeu2019s current performance.
    Appraisal
    During the appraisal, the manager and employee discuss the extent to which the employee has fulfilled the set objectives. They check and assess the employeeu2019s overall performance and the implementation of concrete set objectives. Any further training requirements or an overfulfillment of the objectives are identified in the different areas. The appraisal document is completed when the manager and employee agree on an valuation. As soon as the appraisal document is saved in the system as Completed or Approved, the employeeu2019s compensation can be adjusted automatically and the employeeu2019s qualifications profile can be updated
    Get the proper information from following .
    https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=53773.

  • Accessing knowledge management documents using webdynpro for java

    Dear all,
    iam having some documnets in KNLOWLEDGE MANAGEMENT documents folder in portal using webdynpro for java clicking on a link means perner(employee no) i should get that perpicular employee number documents.
    examples documents are stored like this in knowledege management folder 20016319.pdf  ,  20016397.pdf  ,  20016398.
    how to access those employee using webdynpro for java for perticular employee number if i want 20016319
    Send me the code for above requirement and where i have to wrirte that code exactly
    Regards

    Dear Kishore,
    To get the Employee ID you have to create a Adaptive RFC Model (call BAPI) which will return you the employee pernr, for this
    1. Create a model using  : BAPI_EMPLOYEE_GETDATA
    2. Get User ID using the code
    public java.lang.String getUserID( )
        //@@begin getUserID()
         String userID = new String();
              try
                    // getting Logged in userid
                   IWDClientUser myUser = WDClientUser.getCurrentUser();
                   userID = myUser.toString().substring(19).trim();
                   StringTokenizer filterdUID = new StringTokenizer(userID,")");
                   userID = filterdUID.nextToken();
              catch (WDUMException e)
                   e.printStackTrace();
                   return userID;
        //@@end
    3. Execute the BAPI
    public java.lang.String getEmployeeID( java.lang.String userID )
        //@@begin getEmployeeID()
         String employeeID = new String();
              Bapi_Employee_Getdata_Input employeeData = new Bapi_Employee_Getdata_Input();
              Bapi_Employee_Getdata_Output outData = new Bapi_Employee_Getdata_Output();
              Bapip0105B comm = new Bapip0105B();
              com.sap.aii.proxy.framework.core.AbstractList list = new Bapip0105B.Bapip0105B_List();
              list.add(comm);
              employeeData.setUserid(userID);
              Calendar cal = Calendar.getInstance(Locale.UK);
              Date date = new Date(cal.getTimeInMillis());
              employeeData.setDate(date);
              employeeData.setAuthority_Check("");
              employeeData.setCommunication(list);
              outData.addCommunication(comm);
              wdContext.nodeBapi_Employee_Getdata_Input().bind(employeeData);
              wdContext.nodeOutput_BAPI().bind(outData);
            try
                   wdContext.nodeBapi_Employee_Getdata_Input().currentBapi_Employee_Getdata_InputElement().modelObject().execute();
                   wdContext.nodeOutput_BAPI().invalidate();
            catch (WDDynamicRFCExecuteException e) {printMsg("Failed to Obtain Employee Data");
                 e.printStackTrace();
            employeeID = wdContext.nodeBapi_Employee_Getdata_Input().nodeOutput_BAPI().nodeOrg_Assignment().currentOrg_AssignmentElement().getPerno();
            return employeeID;
        //@@end
    Hope it Helps!!
    Warm Regards
    Upendra Agrawal

  • How to access SAP Solution Manager from webDynpro Application.

    Hi to all,
              I have to retrieve some informations from SAP Solution Manager. and update some recordes there itself. How could i do it??
              If anybody have codes related to it please send the same.
    Please help its urgent.
    Waiting for reply.
    Thanks and Regards;
    Pankaj Kumar.

    Hi
    See this help
    http://help.sap.com/saphelp_nw2004s/helpdata/en/5b/6e8c42c398173be10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/4c/758c42d781d665e10000000a155106/frameset.htm
    Kind Regards
    Mukesh

  • How to set up KM folder with Anonymous access.

    Experts,
    I would like to setup a KM folder with anonymous access where any document on that folder can be viewed by anonymous users by clicking on a link specific to that document. For example: http://server/irj/go/km/docs/documents/TechDocs/file_name.html
    Please note that this document will not be rendered through an iView, so setting up an anonymous role will not work in this case.
    Can anyone tell if this will be doable and the steps to do it?
    Thanks in advance for your help.
    Regards,
    Abu

    Hi Abu,
    > How can I just give access to a specific folder under /irj/go/km/docs?
    You have to differentiate between anonymous access to the iView behind /irj/go/km/docs (PCD auth scheme) and the permissions on KM folders (KM permissions). If you want to restrict the access, on the folders which should not be accessible for anonymous access, remove the group "Everyone" from the permissions (via details / settings / permissions). For details see http://help.sap.com/saphelp_nw04/helpdata/en/1b/12c49eb27011d5993800508b6b8b11/frameset.htm
    Hope it helps
    Detlev

  • How to call a servlet from Webdynpro application

    Hi All,
        I am new to SAP . I have requirement to call a SERVLET which is on a different application server from my webdynpro application , the servlet will return a file .. i need to display that file to the user .. can some one tell me how this can be done .. If possibel please provide some sample code.
    Regards,
    Tarun.

    Hi
    Check this
    1. How to access Servlet information from a webdynpro application ?
    Regards
    Abhijith YS

  • Using Java Applet in WebDynpro Application

    Hello,
    I have the problem that I must access the client in my WebDynpro Application.
    But I found no way to include a Java Applet in my application, so my question: Is it generally possible to include a Java Applet or not?
    If it is not possible with an Applet, is there any other way to access the client?
    Thanks a lot

    We actually embed Java applets in our application. But only on the portal.
    Wrap the applet around a BSP.
    Call the URL in an iframe.
    To prevent the reloading problems that we see with applets and actions, we put the applet in a modal window, with an OK button at the bottom so that when applet processing is finished, the rest of the web dynpro functionality resumes.
    If you need to have them both in the same page, you can embed the BSP iview in the same portal page.

  • Upload / Download document to KM Content Server from WebDynpro Application

    I have a requirement where I need to upload / download document into / from KM Content Server from my WebDynpro Application.
    Is it technically possible and if Yes, can I get any Sample code for this.

    Hi Tahzeeb,
    first of all i would point you to the JavaDocs for KMC API.
    https://media.sdn.sap.com/javadocs/NW04/SPS15/km/index.html
    And here is a small example of reading and storing KM resources.
    For reading:
         * Returns a resource as an InputStream from the KM repository
         * at the given path. The IUser is needed for authorization.
         * @param user      IUser for checking authorisation.
         * @param resPath   Path to the KM resource.
         * @return          Requested resource as a stream.
        private InputStream getKmResource(final IUser user, final String resPath)
            throws ResourceAccessException {
            try {
                final IResourceFactory factory = ResourceFactory.getInstance();
                final RID rid = RID.getRID(resPath);
                final IResource kmResource =
                    factory.getResource(
                        rid,
                        new ResourceContext(getDeprecatedIUser(user)));
                if (kmResource == null) {
                    throw new ResourceNotFoundException(
                        "KM resource not found: " + resPath,
                        resPath);
                return kmResource.getContent().getInputStream();
            catch (WcmException e) {
                throw new ResourceAccessException("Error accessing KM resource: " + resPath, e, resPath);
    And for writing:
         * Stores a resource in the KM repository at the given path with the given name and mimetype.
         * Content is taken from the given inputstream.
         * @param user          IUser for checking authorisation.
         * @param resName   Name of the resource
         * @param resPath     Path to the resource
         * @param mimeType MimeType of the resource
         * @param inputStream  Resource content
         * @throws ResourceAccessException
        private void putKmResource(
            final IUser user,
            final String resName,
            final String resPath,
            final String mimeType,
            final InputStream inputStream)
            throws ResourceAccessException {
            try {
                final ResourceContext rContext = new ResourceContext(getDeprecatedIUser(user));
                final RID rid = RID.getRID(resPath);
                final ICollection kmCollection =
                    (ICollection) ResourceFactory.getInstance().getResource(rid, rContext);
                if (kmCollection == null) {
                    throw new ResourceNotFoundException(
                        "KM resource not found: " + resPath,
                        resPath);
                else {
                    IContent kmContent = new Content(inputStream, mimeType, -1);
                    IResource kmResource = kmCollection.createResource(resName, null, kmContent);
            catch (ResourceException e) {
                throw new ResourceAccessException("Error accessing KM resource: " + resPath, e, resPath);
            finally {
                try {
                    inputStream.close();
                catch (IOException e1) {
                    throw new ResourceAccessException("Error closing InputStream when accessing " + resPath, e1, resPath);
    Hope that helps for a start.
    Best regards,
      ok

  • Cannot access WebDynpro application:com.sap.tc.webdynpro.services.exception

    Hello gurus!!
      I am trying to access the "Emergency address" from the LWE and I am getting this error "Cannot access Web Dynpro application: com.sap.tc.webdynpro.services.exceptions.WDException$DummyLocalizableTextFormatter@76829226". Could anybody please suggest what could be wrong with this action "Emergency Address"?
    Thanks much for your help with this,
    Maria Kutty Somori....

    Hi Yugandhar/Siddharth,
       Emergency address is the standard callable object for Execution that is part of the Standard Life and Work events. I have customized to reorganize the actions depending on our requirements and i have created a different folder structure and different order of execution of callable objects.
    How do I fix this "cannot access Webdynpro application" error? Please suggest.
    Thank you so much,
    Maria Kutty Somori.....

  • How to access internal table data from webdynpro to Flex application.

    Hi Connoisseur
    The data transfer from Abap WebDeypro to flex island works well. I followed , there is an example from Thomas Jung (by the way as always Great Work) and  Karthikeyan Venkatesan (Infosys) but this example covers simple type only.
    There is no example with complex types like arrayCollection which handle the transfer of data from flex to WebDynpro.
    i tried to do pass internal table value  to flex-datagrid.but its not work.
    i would like to know
    1.how to access internal table data from webdynpro to Flex application.
    2.how to pass the internal table to flex-datagrid.
    2.how to pass dynamically in ADOBE flex.
    3. how to do Flex is receiving the wd context data?
    4. how can we update WD context with FLEX data.
    Ple give me sample example and step by step procedure.
    Regards
    laxmikanth

    Hi Laxmikanth,
    Please refer this...
    Flash island: update complex type from flex
    Cheers..
    kris.

  • Not able to access the WebDynpro application in BlackBerry.

    Hi,
    I have created a WebDynpro application. The application is workin fine on IE but when I access the same application from BlackBerry simulator 8830 it gives an error :
    500 Internal Server error.
    APPLICATION ERROR OCCURED DURING THE REQUEST PROCESSION
    THE REQUESTED DEPLOYABLE OBJECT "InventryLookUpApp" is not deployed on the server.
    Please check the URL for typos
    The URL for the application is :
    http://10.54.162.252:50000/webdynpro/dispatcher/sap.com/a1s~searchproduct/InventoryLookupApp
    Please guide.
    Manish

    Hi Manish,
    Try this link:
    http://10.54.162.252:50000/webdynpro/dispatcher/sap.com/a1s~searchproduct/InventoryLookupApp?sap-wd-client=WmlClient
    Let me know what happens.
    Thanks,
    Ted

  • How to access(connect) BI Data in webdynpro for java applications

    Hi ,
    is there any way to access and display the BI data in portal using webdynpro for java applications like we did in Visual composer.
    if not how to integrate the BI data in webdynpro applications ?
    Regards,
    Govindu

    Hi,
    Yes there are ways to do it. But may your scenario and the scenario for which I have done may differ.
    You can use openhub to get the data in a flat file and then read it into weddynpro through a java service OR
    You can use DBlink(which i have done).
    Please refer the link below:
    [Link|Data from BW to Oracle.;
    This I have done in NW04s. Not sure whether a better solution is available in the newer release.
    Hope it helps.
    Regards,
    Manoj

Maybe you are looking for

  • After updating to iOS 7, nothing is working (App Store, Facebook). If you have any suggestions on how to fix it, it would be greatly appreciated!

    Hi, I downloaded iOS 7 recently. Everything was fine until I checked my apps and saw that there was something to update. I tried to update it and it won't work. Also whenever I try to put in my Apple ID and password for anything (ex. iMessage, etc.)

  • Portability of xpath?

    Quick question about the use of xpath. I notice you can write custom xpath expressions and it looks like there are xpath expressions available with an oracle namespace. If i were to use one of these functions in my Bpel process and then later decide

  • RoboHelp  for Word 7 is not saving the rtf and won't compile .hlp

    I use RoboHelp for Word 7 to produce WinHelp files. It's been working fine for several months on this computer. Just in the past week, I had an issue with my Word 2007 when trying to open a .doc file. I got the message that the converter nswrd632.wpc

  • Lion - Reporting a problem to Apple

    Apple don't really appear to be interested in supporting Lion. I have just received an email receipt for my purchase of Lion (via App Store). In that email is a link labelled as "Report a problem". So I clicked the link because I would very much like

  • How do I actually INSTALL Adobe Reader?

    So far, I've managed to install 2 ADOBE READER INSTALLERS, but can't seem to actually install ADOBE READER.  At this rate I'll have a desktop full of INSTALLERS and "still no READER".  Can I drag one installer into trash?  Please help me get off this