Getting Response attribute using IDXML

Hi All,
When i am trying to change the password..... I 'll be thrown a page where i have to enter the challenge response for the questions configured..... I am trying to compare the value of the challenge response exists with the user profile with the response i am entering in the change password page.... But i am not able to get the response value from the user profile using IDXML.... can anyone help me in this regard.....

When the user forgets the password... then the user will be redirected to supply the challenge answers he selected at the time of registration... I need to check whether the responses entered by the user in the application against the OAM using IDXML...

Similar Messages

  • How to get response header using ActionScript and MXML?

    So... I have a URL like www.example.com/stream/
    I need to make any request to this url and get Http Rewspons header (like this one:
        HTTP/1.0 200 OK
        Content-type: video/x-flv
        Cache-Control: no-cache
    I do not need reponse body at all. After I get header need to emmidiatly close connection to that url (so stop to obtain data from it)
    How to do such thing (I use Flash builder)?

    Hai Mahesh
    Check the following Code
    Data : i_entamiot     LIKE   ehswas_entamiot.
    DATA: gv_batchattributes LIKE bapibatchatt.
    DATA: batchstatus    LIKE bapibatchstatus.
    DATA: lt_bapi_ret        LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
          CALL FUNCTION 'BAPI_BATCH_GET_DETAIL'
            EXPORTING
              material        = i_entamiot-matnr
              batch           = i_entamiot-charg
              plant           = i_entamiot-werkss
            IMPORTING
              batchattributes = gv_batchattributes
              batchstatus     = batchstatus
            TABLES
              return          = lt_bapi_ret.
    Thanks & regards
    Sreenivasulu P

  • How to get static attribute using it's name as a string

    I have an app with about 100 unique combo boxes (it's a gov't requirement, I'm not that bad a designer ) and I would like to define all the choices in a single separate file like this:
    package components {
    import mx.collections.ArrayCollection;
        public class Choices    {
      [Bindable] public static var A0310A:ArrayCollection = new ArrayCollection ( [
                                          { value:"01", label:"Admission"},
                                          { value:"02", label:"Quarterly" },   
                                     ........snip ..
                                          { value:"99", label:"NOT OBRA Required" }]);
              public static function getChoices(name:String):ArrayCollection {
                  var temp:ArrayCollection = ????????????????
                  return temp;
        }//----------------end of class--------------------------------
    }//======================== end of package==============================
    I want to use it like this
    <my:ComboBox id="mdscombo" tag="A0310A" />
    Where the definition of my:ComboBox includes code like this
                 var zz:ArrayCollection = Choices.getChoices(name);
    but I cannot find any function that will let me do this.  I really don't want to clutter the code by creating a name->object lookup table.
    I had also considered using the XML data type but I would have the same issue unless I had all the choices under a single root (possible) but that could be a nightmare in debugging typo's in the XML.
    Any suggestions???

    The technique you describedd worked perfectly.
    I've yet to deploy my first production app in Flex, so I would appreciate what you see in my approach that is "not desireable"  If I'm heading down a bad path I would like to know while I can still refactor.

  • Getting operational ldap attributes using amSDK

    Is there any way to get operational ldap attributes of a user? I am trying to get "passwordexpirationtime" attribute.
    amUser.getStringAttribute("passwordexpirationtime");
    does not return anything.. no exceptions.
    tried getAttributesFromDataStore, that too does not return anything..
    Set attr = new HashSet();
    attr.add("passwordexpirationtime");
    Map exptime = amUser.getAttributesFromDataStore(attr);
    is this supported?
    Using JES2005Q4 with AM patch - 120954-04
    Regards,
    Pradeep.

    Hi Bill,
    First I like to state that I'm not an expert on CUEAC. Have you looked at this post,
    https://supportforums.cisco.com/message/4071453#4071453
    I don't knoiw if it's realted or not, but the guy answering seems to be well versed in CUEAC.
    Please remember to rate helpful responses and identify helpful or correct answers.

  • I have a mac OSX desktop version 10.6.8 and all of a sudden I can't get a full screen view in Safari when I ask for help the response is use the arrows on the top right of the screen ... I don't have them  ... can anyone help?

    I have a mac OSX desktop version 10.6.8 and all of a sudden I can't get a full screen view in Safari when I ask for help the response is use the arrows on the top right of the screen ... I don't have them  ... can anyone help?

    Hi Mary,
    I don't remember those arrows in 10.6, only 10.7 & up!?
    I have 10.6.8, as you do. To make your Safari full screen, make sure you have the left hand side of your safari page moved  all the way to the left.  Then move your cursor to the BOTTOM RIGHT CORNER of the safari page, and simply drag your page towards the lower right hand corner of the screen. NOTE: you will see a series of lines on the bottom right corner of the page, indicating where to place you cursor arrow.
    By wuzradioman here...
    https://discussions.apple.com/thread/4218928?start=0&tstart=0

  • Getting Attributes using MDM WebServices

    Hello all,
    i'm trying to get the attributes associated to a taxonomy field from a taxonomy table.
    I'm using MDM WebServices to achieve this task.
    Can some one help me out on how to set the input schema to search for the attributes alone?
    Thanks!
    arun

    To rephrase my question,
    How do i search on a taxanomy table to retrieve the attributes associated to a child element using webservices?
    Thanks
    ak.

  • Getting error message while updating Job attributes using PP03 for IT1641

    Hey Guys,
    We are getting error message while updating Job attributes using transaction PP03 for IT1641 (WC Attributes for JOB): 'Client has status not modifiable'.
    Update to the infotype 1641 should not require open SAP system. Would anyone suggest any SAP note/solution?
    Thanks...
    Edited by: Karan Gheewala on Apr 3, 2008 9:06 PM

    Solved using Note 123383 - WC: Customizing worker's compensation tables
    Thanks,..

  • Getting the attributes of an object by using a URL

    Hi,
    Here is my problem. I want to access to the attributes of an object stored in an LDAP. I know this object when I receive this kind of url:
    ldap://163.187.83.145:389/ou=People,dc=slb,dc=com,uid=TOTO;
    How can I get the attributes of the uid without changing the code below. If I set the context_provider with this url, I am pointing on the right object but my problem is to get its attributes.
    Does anyone know how to do?
    Here is an example of my code:
    String ldap_URL = ldap://163.187.83.145:389/ou=People,dc=slb,dc=com,uid=TOTO;
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, ldap_URL);

    Hello !!
    You can very well carry on with your code , to get the attributes you can have a look at this code snippet :
    import java.io.*;
    import java.util.Hashtable;
    import javax.naming.*;
    import javax.naming.directory.*;
    class GetAttr {
         public static void main(String args[]) {
              Hashtable env = new Hashtable();
              String attname=null;
    String ldap_URL="ldap://163.187.83.145:389/ou=People,dc=slb,dc=com,uid=TOTO";
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              env.put(Context.PROVIDER_URL, ldap_url);
              try {
                   DirContext ctx = new InitialDirContext(env);
                   String[] strAttrID={"objectClass","cn","userPassword"};
                   Attributes attrs = ctx.getAttributes("",strAttrID);
                   for (
                        NamingEnumeration ae = attrs.getAll();
                   ae.hasMore();
                   Attribute attr = (Attribute)ae.next();
                   System.out.println("\n" + attr.getID());
                   for (
                             NamingEnumeration e = attr.getAll();
                             e.hasMore();
                             System.out.print(" : " + e.next() +"\t")
              catch (NamingException ne) {
                   ne.printStackTrace();
    1.See this line ctx.getAttributes("",strAttrID)....this means that in the URL itself you have given JNDI the complete reference or key to locate the object. For eg: if uid=TOTO was not present in your URL , you could have done ctx.getAttributes("uid=TOTO",strAttrID).
    2.This will print only the 3 attributes I have specified(objectclass,cn,password).You can add your own according to the attributes u have in your LDAP directory (see in LDIF.txt or <some-name>.ldif)
    Hope this helps
    Regards
    Chandu

  • Problems in setting user attributes using amclientsdk

    Hi,
    I am trying to set user attributes using amclientsdk. I am using the below mentioned piece of code for the same:
    AMIdentity idn = new AMIdentity(auth1.getSSOToken());
    Set s = new HashSet();
    s.add("cn=adviser,dc=axa,dc=au");
    Map roleMap = new HashMap();
    String userRoleKey = "nsRole";
    roleMap.put(userRoleKey,s);
    amIdObj.setAttributes(roleMap);
    amIdObj.store();
    The AMIdentity type is USER. The environment is Linux and I have amclientsdk.jar in my classpath. When I run the above piece of code then I get the following exception:
    Exception in thread "main" java.lang.ExceptionInInitializerError
    at com.sun.identity.idm.plugins.ldapv3.LDAPv3Repo.checkConnPool(LDAPv3Repo.java:4516)
    at com.sun.identity.idm.plugins.ldapv3.LDAPv3Repo.addListener(LDAPv3Repo.java:1051)
    at com.sun.identity.idm.server.IdServicesImpl.getAllConfiguredPlugins(IdServicesImpl.java:2490)
    at com.sun.identity.idm.server.IdServicesImpl.getFullyQualifiedNames(IdServicesImpl.java:209)
    at com.sun.identity.idm.server.IdCachedServicesImpl.getFullyQualifiedNames(IdCachedServicesImpl.java:588)
    at com.sun.identity.idm.AMIdentity.getFullyQualifiedNames(AMIdentity.java:1162)
    at com.sun.identity.idm.AMIdentity.equals(AMIdentity.java:1091)
    at com.sun.identity.delegation.DelegationEvaluator.isAllowed(DelegationEvaluator.java:140)
    at com.sun.identity.idm.server.IdServicesImpl.checkPermission(IdServicesImpl.java:2906)
    at com.sun.identity.idm.server.IdServicesImpl.setAttributes(IdServicesImpl.java:1402)
    at com.sun.identity.idm.server.IdCachedServicesImpl.setAttributes(IdCachedServicesImpl.java:467)
    at com.sun.identity.idm.AMIdentity.store(AMIdentity.java:457)
    at ProcessAuth.main(ProcessAuth.java:131)
    Caused by: java.util.MissingResourceException: Can't find bundle for base name amLDAPv3Repo, locale en_US
    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:836)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:805)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:576)
    at com.iplanet.am.util.Locale.getInstallResourceBundle(Locale.java:255)
    at com.sun.identity.idm.plugins.ldapv3.LDAPv3Bundle.<clinit>(LDAPv3Bundle.java:56)
    ... 13 more
    Any help on this would be greatly appreciated !

    Thanks for a response Aaron !
    Probelm is I am not even able to set nsroledn attribute using amIdentity's store() method. I am able to set other attributes using store() but not these role related attributes.

  • Not able to get the attributes from HttpSession

    hi all,
    i'm using session.setAttribute() in a jsp to put an attribute in the session and when i try to get that attribute in another jsp it's not giving the value. But the getAttribute() mehods is giving the value in the same jsp page where i used the setAttribute() method.
    pls help,
    regards chandu

    If you are using IE go to tool and then internet options and look under privacy for you cookie status(this will vary version).
    To use URL rewriting all you have to do is one of two things:
    www.url.com?parm=value&param2=value
    or if the value is a result of a java expression or is a java variable you can do
    www.url.com?parm=<%=variable%>&param2=<%=(variable +1)%>
    You get the values from url rewriting by using request.getParameter or getParameterValues(used when multiple values are getting passed).
    When data is retrieved using getParameter it always comes back as a string and you should trim them as well.
    HTH,
    J.Clancey

  • How to get multiple values using HttpSession.getAttribute(java.lang.String)

    Hey Guys
    I'm trying to find a way to get multiple values using the following method
    HttpSession.getAttribute(java.lang.String)
    Here's the scenerio. Its a already written application and now i'm trying to make some changes. earlier in the jsp page a combo box was used and value was retrieved in the servlet using the getAttribute method of Session. Now I'm using a html multiple selection list and have to retrieve all the values selected in the list in the servlet. Can anyone please suggest me how to do that. HTTPRequest class has a method getParameterValues which will let me do that but i have to do is using HTTPSession.
    Thanks for your time to read this

    I'm not sure what you are trying to do. You can only use session.getAttribute to retrieve something that has already been stored in the session with a previous setAttribute. If you need to store multiple values under one attribute name using setAttribute, you can store an array, or an ArrayList or whatever type of Collection you want. The request.getParameterValues method is the only way you can retrieve form parameters than can have multiple values. If the servlet hasn't already processed these parameters and put them into the session for you, you have to use request.getParameterValues.

  • How to Get Navigational attributes of dso in Report ...

    Hi i have a dso with many fields ,
    In the report i need to get some navgational attributes which are in dso..
    How to Get Navigational attributes of dso in Report ..??
    Thanks All..

    hai naiduz,
    in the dso u find folder with navigational attributes, there select the Navigation check box the fields which u need in the report.
    and further if ur dso through multiprovider and also identify them at multi provider level.
    then u will be able to see the fields at query designer level, then u can use the nav. fields u need in the report.
    regards,
    Vj

  • Populating CRM marketing attributes using the APD

    Hi Experts
    We are having problems with populating CRM marketing attributes using the APD. When we run our process we get the error message:
    CRMBW_ATTR_WRITE005: Error when processing function module CRMBW_UPDATE_BPMKT_5. Message no. RSAN_MDL024
    As you can see, we are using the new function module CRMBW_UPDATE_BPMKT_5 since the old CRMBW_UPDATE_BPMKT did not work either.
    Do we have to add a reference to a infoobject in transaction CRMBWTARGETS? We have not done this because the marketing attribute in CRM doesn’t have decimals and all the objects in BI have. Could this be the cause of the error?
    Kind regards
    Erik

    Hi Ramesh,
    Thanks for quick reply.
    I have already followed the procedure you have described. Since there is not common objects between ODS and Bpatner infoobject, i am not able to do mapping.
    for eg. my ZBPARTNER infoobject has attributes like zfooty, ztennis and zrugby but my ODS has char name , char value, counter for multiple values infoobjects.
    I am following the example in the demo content to work out the process but could not understand how the data is getting uploaded from ODS to Business partner.
    http://help.sap.com/saphelp_nw70/helpdata/en/bf/5df63bf9deaf09e10000000a114084/frameset.htm
    Thanks,
    Sandeep Jogde

  • Issue: Not getting response when the document is having special chars

    Please help following issue: Not getting response when the document is having special chars(Use any doc with special char(ex: &, $, <, >,.....) TestErrorFour.doc
    Error message:
    System.FormatException: Invalid length for a Base-64 char array. at
    System.Convert.FromBase64String(String s) at
    Summarize.Summarizer.AccumulateBroadcast(String filedata, String givenWords) in
    c:\DocumentSummarizer\App_Code\Summarizer.cs:line 66
    Code:
    File 1:
    import java.io.BufferedReader;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.net.URLConnection;
    import java.util.Properties;
    import org.apache.poi.poifs.filesystem.POIFSFileSystem;
    import org.apache.poi.hwpf.*;
    import org.apache.poi.hwpf.extractor.*;
    import com.lowagie.text.Document;
    import com.lowagie.text.pdf.PRTokeniser;
    import com.lowagie.text.pdf.PdfReader;
    public class DocumentSummarizerClient {
         static Properties loadProperties() {
              Properties prop = new Properties();
              try {
                   prop.load(DocumentSummarizerClient.class.getClassLoader().getResourceAsStream("vep.properties"));
              } catch (Exception ioe) {
                   ioe.printStackTrace();
              return prop;
         public String getSummary(String fileName,String noOfWordsOrPercentage ){
              String summaryInputData ="";
              String summarizedData="";
              String summarizerURL = loadProperties().getProperty("Summarizer.serviceURL");
              try {
                   String fileExtension=fileName.substring(fileName.lastIndexOf(".")+1, fileName.length());
                   if (fileExtension.equalsIgnoreCase("doc")|| fileExtension.equalsIgnoreCase("txt")|| fileExtension.equalsIgnoreCase("pdf")) {
                                  if (fileExtension.equalsIgnoreCase("txt")) {
                                       BufferedReader bufferedReader = new BufferedReader(
                                                 new FileReader(fileName));
                                       String line = null;
                                       while ((line = bufferedReader.readLine()) != null) {
                                            summaryInputData += line;
                                  if(fileExtension.equalsIgnoreCase("doc")){
                                       POIFSFileSystem fs = null;
                                        fs = new POIFSFileSystem(new FileInputStream(fileName));
                                         HWPFDocument doc = new HWPFDocument(fs);
                                         WordExtractor we = new WordExtractor(doc);
                                         String[] paragraphs = we.getParagraphText();
                                         for( int i=0; i<paragraphs .length; i++ ) {
                                            paragraphs[i] = paragraphs.replaceAll("\\cM?\r?\n","");
                                  summaryInputData+= paragraphs[i];
                                  if(fileExtension.equalsIgnoreCase("pdf")){
                                       Document document = new Document();
                   document.open();
                   PdfReader reader = new PdfReader(fileName);
                   int pageCount =reader.getNumberOfPages();
                        for(int i=1;i<=pageCount;i++){
                                  byte[] bytes = reader.getPageContent(i);
                                  PRTokeniser tokenizer = new PRTokeniser(bytes);
                                  StringBuffer buffer = new StringBuffer();
                                  while (tokenizer.nextToken()) {
                                  if (tokenizer.getTokenType() == PRTokeniser.TK_STRING) {
                                  buffer.append(tokenizer.getStringValue());
                                  summaryInputData += buffer.toString();
                   else{
                        System.out.println("This is Invalid document. Presntly we support only text,word and PDF documents ");
                   // String encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String encoded=Base64Utils.base64Encode(summaryInputData.getBytes());
                   // encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String parameters= "base64String="+encoded+"&noOfWordsOrPercentage="+noOfWordsOrPercentage;
                        summarizedData= postRequest(parameters,summarizerURL);
                        String slength= "<string xmlns=\"http://tempuri.org/\">";
                        if(summarizedData.contains("</string>")){
                        summarizedData= summarizedData.substring(summarizedData.indexOf(slength)+slength.length(),summarizedData.indexOf("</string>"));
                        summarizedData = replaceVal(summarizedData);
                        //System.out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?><![CDATA["+summarizedData+"]]>");
                        // System.out.println("Summarized data "+summarizedData);
                        if(summarizedData.contains("Please enter the percentage")){
                             summarizedData="Data given cannot be summarized further";
                   else{
                        System.out.println("Data given cannot be summarized further");
                        summarizedData="";
              } catch (FileNotFoundException e) {
                   return("The File is not found \n\n"+e.toString());
              } catch (IOException e) {
                   return("The File is already in use \n\n"+e.toString());
              } catch (Exception e) {
                   return(e.toString());
              return summarizedData;
         public static String postRequest(String parameters,String webServiceURL) throws Exception{
              Properties systemSettings = System.getProperties();
              systemSettings.put("http.proxyHost", loadProperties().getProperty("proxyHost"));
         systemSettings.put("http.proxyPort", loadProperties().getProperty("proxyPort"));
         System.setProperties(systemSettings);
              String responseXML = "";
              try {
                   URL url = new URL(webServiceURL);
                   URLConnection connection = url.openConnection();
                   HttpURLConnection httpConn = (HttpURLConnection) connection;
                   byte[] requestXML = parameters.getBytes();
                   httpConn.setRequestProperty("Content-Length", String
                             .valueOf(requestXML.length));
                   httpConn.setRequestProperty("Content-Type",
                             "application/x-www-form-urlencoded");
                   httpConn.setRequestMethod("POST");
                   httpConn.setDoOutput(true);
                   httpConn.setDoInput(true);
                   OutputStream out = httpConn.getOutputStream();
                   out.write(requestXML, 0, requestXML.length);
                   out.close();
                   InputStreamReader isr = new InputStreamReader(httpConn
                             .getInputStream());
                   BufferedReader br = new BufferedReader(isr);
                   String temp;
                   String tempResponse = "";
                   while ((temp = br.readLine()) != null)
                        tempResponse = tempResponse + temp;
                   responseXML = tempResponse;
                   br.close();
                   isr.close();
              } catch (java.net.MalformedURLException e) {
                   System.out
                             .println("Error in postRequest(): Secure Service Required");
              } catch (Exception e) {
                   System.out.println("Error in postRequest(): " + e.getMessage());
              return responseXML;
         public String replaceVal(String value) {
                   if (value == null) {
                        value = "";
                   value = value.replace("&lt;", "<");
                   value = value.replace("&gt;", ">");
                   value = value.replace("&amp;", "&");
                   return value;
              public static void main(String[] args) {  
                   DocumentSummarizerClient testdoc=new DocumentSummarizerClient();
                   System.out.println("hello");               
                   testdoc.getSummary("C:\\working_folder\\vep\\UnitTestCases\\VEP1.0\\DocumentSummarizerTestData\\TestErrorFour.doc","100%");     
    Note: Use any doc with special char(ex: &, $, <, >,.....) TestErrorFour.doc
    File 2:
    ---------public class Base64Utils {
    private static byte[] mBase64EncMap, mBase64DecMap;
    * Class initializer. Initializes the Base64 alphabet (specified in RFC-2045).
    static {
    byte[] base64Map = {
    (byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F',
    (byte)'G', (byte)'H', (byte)'I', (byte)'J', (byte)'K', (byte)'L',
    (byte)'M', (byte)'N', (byte)'O', (byte)'P', (byte)'Q', (byte)'R',
    (byte)'S', (byte)'T', (byte)'U', (byte)'V', (byte)'W', (byte)'X',
    (byte)'Y', (byte)'Z',
    (byte)'a', (byte)'b', (byte)'c', (byte)'d', (byte)'e', (byte)'f',
    (byte)'g', (byte)'h', (byte)'i', (byte)'j', (byte)'k', (byte)'l',
    (byte)'m', (byte)'n', (byte)'o', (byte)'p', (byte)'q', (byte)'r',
    (byte)'s', (byte)'t', (byte)'u', (byte)'v', (byte)'w', (byte)'x',
    (byte)'y', (byte)'z',
    (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5',
    (byte)'6', (byte)'7', (byte)'8', (byte)'9', (byte)'+', (byte)'/'};
    mBase64EncMap = base64Map;
    mBase64DecMap = new byte[128];
    for (int i=0; i<mBase64EncMap.length; i++)
    mBase64DecMap[mBase64EncMap[i]] = (byte) i;
    * This class isn't meant to be instantiated.
    private Base64Utils() {
    * Encodes the given byte[] using the Base64-encoding,
    * as specified in RFC-2045 (Section 6.8).
    * @param aData the data to be encoded
    * @return the Base64-encoded <var>aData</var>
    * @exception IllegalArgumentException if NULL or empty array is passed
    public static String base64Encode(byte[] aData) {
    if ((aData == null) || (aData.length == 0))
    throw new IllegalArgumentException("Can not encode NULL or empty byte array.");
    byte encodedBuf[] = new byte[((aData.length+2)/3)*4];
    // 3-byte to 4-byte conversion
    int srcIndex, destIndex;
    for (srcIndex=0, destIndex=0; srcIndex < aData.length-2; srcIndex += 3) {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] >>> 2) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] >>> 4) & 017 |
    (aData[srcIndex] << 4) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+2] >>> 6) & 003 |
    (aData[srcIndex+1] << 2) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[aData[srcIndex+2] & 077];
    // Convert the last 1 or 2 bytes
    if (srcIndex < aData.length) {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] >>> 2) & 077];
    if (srcIndex < aData.length-1) {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] >>> 4) & 017 |
    (aData[srcIndex] << 4) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] << 2) & 077];
    else {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] << 4) & 077];
    // Add padding to the end of encoded data
    while (destIndex < encodedBuf.length) {
    encodedBuf[destIndex] = (byte) '=';
    destIndex++;
    String result = new String(encodedBuf);
    return result;
    * Decodes the given Base64-encoded data,
    * as specified in RFC-2045 (Section 6.8).
    * @param aData the Base64-encoded aData.
    * @return the decoded <var>aData</var>.
    * @exception IllegalArgumentException if NULL or empty data is passed
    public static byte[] base64Decode(String aData) {
    if ((aData == null) || (aData.length() == 0))
    throw new IllegalArgumentException("Can not decode NULL or empty string.");
    byte[] data = aData.getBytes();
    // Skip padding from the end of encoded data
    int tail = data.length;
    while (data[tail-1] == '=')
    tail--;
    byte decodedBuf[] = new byte[tail - data.length/4];
    // ASCII-printable to 0-63 conversion
    for (int i = 0; i < data.length; i++)
    data[i] = mBase64DecMap[data[i]];
    // 4-byte to 3-byte conversion
    int srcIndex, destIndex;
    for (srcIndex = 0, destIndex=0; destIndex < decodedBuf.length-2;
    srcIndex += 4, destIndex += 3) {
    decodedBuf[destIndex] = (byte) ( ((data[srcIndex] << 2) & 255) |
    ((data[srcIndex+1] >>> 4) & 003) );
    decodedBuf[destIndex+1] = (byte) ( ((data[srcIndex+1] << 4) & 255) |
    ((data[srcIndex+2] >>> 2) & 017) );
    decodedBuf[destIndex+2] = (byte) ( ((data[srcIndex+2] << 6) & 255) |
    (data[srcIndex+3] & 077) );
    // Handle last 1 or 2 bytes
    if (destIndex < decodedBuf.length)
    decodedBuf[destIndex] = (byte) ( ((data[srcIndex] << 2) & 255) |
    ((data[srcIndex+1] >>> 4) & 003) );
    if (++destIndex < decodedBuf.length)
    decodedBuf[destIndex] = (byte) ( ((data[srcIndex+1] << 4) & 255) |
    ((data[srcIndex+2] >>> 2) & 017) );
    return decodedBuf;
    issue 2: Exception when passing 2MB .txt file
    Steps to reproduce:
    Call getSummary() with 2MB .txt file
    Actual:
    The following exception has occured:
    1. Error in postRequest(): Unexpected end of file from server
    java.lang.NullPointerException
    Please provide your precious feedback/suggestions.
    Thanks in advance…..
    Edited by: EJP on 15/03/2011 16:52: added code tags. Please use them. Code is unreadable otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Thanks for your response….
    This is enhancement project and some one develops long back.
    Regarding point (b) You should be using the java.net.URLEncoder to encode URL parameters, not a base64 encoder.
    DocumentSummarizerClient.java I am using base64
    Ex:
    // String encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String encoded=Base64Utils.base64Encode(summaryInputData.getBytes());
                   // encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String parameters= "base64String="+encoded+"&noOfWordsOrPercentage="+noOfWordsOrPercentage;
                        summarizedData= postRequest(parameters,summarizerURL);
                        String slength= "<string xmlns=\"http://tempuri.org/\">";
                        if(summarizedData.contains("</string>")){
                        summarizedData= summarizedData.substring(summarizedData.indexOf(slength)+slength.length(),summarizedData.indexOf("</string>"));
                        summarizedData = replaceVal(summarizedData);
                        //System.out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?><![CDATA["+summarizedData+"]]>");
                        System.out.println("Summarized data "+summarizedData);
                        if(summarizedData.contains("Please enter the percentage")){
                             summarizedData="Data given cannot be summarized further";
    Above specific please I need to modify to resolve above issue.
    Could you please suggest me what changes I need to do.
    Waiting for positive response.

  • How can I get the attribute of another app of the JSP server's session

    in one server, use Tomcat 4.1, have two application at
    .../webapps/app1
    .../webapps/app2
    when use login to application1, it'll set a attribute of session use following code:
    session.setAttribute("identitycode", IdentityCode);
    session.setMaxInactiveInterval(SessionTimeOut);
    and the other jsp programs which at app1 directory will try to get the attribute of this session to identity whether the user had login and get the identity code.
    I want to make user just login one time to use application1 and application2, but I didn't know how to get the attribute of session what seted at app1 in app2's programs.
    can you tell me how I can do this?

    If there are 2 different applications like app1 & app2, U need to use:
    application.setAttribute() method.(not session.getAttribute).
    u need to maintain one collection like hash table which will store the mappings of User & their IDs . U can then get the user details from app1 to app2

Maybe you are looking for