Handling special char in the HTTP-RFC ?

Hi Guys,
I have configured a HTTP-RFC and the interface is failing whenevr we have special char from the source xml. we have especially "&" sign, is there any way we handle special char in XI for the HTTP-RFC scenario.
any help would be appreciated
Thanks,
srini

Hi Hemant,
source i have a 3rd party system from where we are doing HTTP-post and it is generating xmls. we have names like Robert&Robert then we are having problems.
when we remove this & it is going through fine. I want to know how can we handle this in XI or do we need to remove that one from the third party system itself
Thanks,
srini

Similar Messages

  • Handling special char at BizTalk end?

    I am receiving message as flat file which may contain special char like <> ' "....... etc
    Can any one tell me how can i handle it at BizTalk end.
    If i am converting it into xml due to data, it is not a valid xml.
    <FirstName> <John miller</FirstName>
    And single quotes ' can create problem in sql query .
    Can any one let me know how could i handle it.

    Hi Phill,
    Let’s be clear when you mean by “special character” in flat-file schema.
    If the special character which your referring are not the delimiters used in your schema or any escape characters (about escape characters I’ll refer later), then as la
    Cour said, XML shall handle them without any issues. If you have these characters, as you highlighted, you will have XML file/element like “<FirstName>
    <John miller</FirstName>”. It’s still a valid XML file.
    But if you don’t want this characters to be saved into SQL database i.e for the above XML element if don’t want the character “<” saved along with “John
    miller” as “<John miller”, then you need to have a custom pipeline component to remove those characters.
    Escape character:
    If you know that a character which could come in an element, then you can use “Escape Character” property for the element where you can specify the character you want to
    ignore. i.e of you expect character “<” to come with FirstName element, then you can specify the escape character property as “<” in the “FirstName” element.
    More special character to ignore:
    As said XML can parse these characters without issue. But if you don’t want to send those characters to your destination system (SQL), then after parsing the flat-file into
    XML, use a custom pipeline component to replace all the special character from the parsed XML.
    Following article discuss about this concept:
    How
    to remove invalid character in incoming XML message using custom pipeline component
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • How can I Retrieve special chars from a HTTP Request??

    Hi,
    I want to retrieve special chars from a request
    Chars like accents used in spanish languages or symbols?
    Is there any way to do it
    Thanks in advance
    Alejandro Arredondo

    This is my problem
    For example:
    This is my form:
    <form>
    <input type="text" name="test">
    </form>
    I do write a char on the text area. Something like "?" or "?"
    or some words with accents
    When I retrieve the value with
    String value = request.getParameter("test");
    and print it
    out.println("TEST= " + test);
    It prints another symbol that isn't the one I sent in my form.
    why?
    Thanks

  • Handle special characters in the attribute name

    Hi,
    I am generating different view element in WD application dynamically. How to handle special characters other than '-/ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789'  for the attribute name dynamically?
    Thank you, in advance.
    Trupti

    Going with the obvious response - don't use them?
    if you're using dynamic code, there is no reason (other than debug support) to give your created elements any meaningful name.
    Just generate a GUID for each new element and use that.
    If you need to be able to later search for and update the element a simple lookup table of GUID to reference string should work reasonably well.
    Cheers,
    Chris

  • How to handle special charecters in the payload

    Hi
       I'm getting special charecterstics  from R/3 side..   that is also some  large data .. but in XI side.. i have a single field..(that is STRING  data type) ..so it was thrwing message mapping exception...
       but  how can we handle that..  is there any limitation that XI  one field can handle this much of data only(limit) because I'm gettinng huge data  for example 24 kb  and 26 kb like that.. this all the data i want to load in a single field..
    and  this data also contain some special charecters.. how can we handle this  type of problems..
    Thanks
    babu

    Hi Babu
    have a look at this pdf for special character
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42
    Read this page:
    http://en.wikipedia.org/wiki/Character_encodings_in_HTML
    for more details you can follow these two links
    http://mail-archives.apache.org/mod_mbox/xerces-j-dev/200004.mbox/%[email protected]%3Eerces-j-dev/200004.mbox/%[email protected]%3E
    http://en.wikipedia.org/wiki/Help:Special_characters
    http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/frameset.htm
    Regds
    Abhishek

  • Handling Special characters in the data set

    Hi All,
    I am facing an issue in hadling special characters while writing data to a flat file.
    The data fetched in toad query is *44CAÑADO* (with some specail character over N), but when this same data is written in textpad using UTL_FILE.put_line, the data written is converted to *44CAÑADO*.
    Can anyone please help me how to handle these special charatcers so that the same data is written in text file as well.
    Regards,
    Shruti

    To find the database characterset, please see (Character Sets & Conversion - Frequently Asked Questions [ID 227330.1] -- 2. What is the database character set used for and how is it set?)
    For your issue, please see these MOS docs.
    UTL_FILE Adds ^U (Control U) NAK Character At the End of the Line. [ID 604150.1]
    Character set conversion when using UTL_FILE [ID 227531.1]
    NLS_LANG Explained (How does Client-Server Character Conversion Work?) [ID 158577.1] -- 5.8 UTL_FILE is writing / reading incorrect characters.
    Thanks,
    Hussein

  • Query to Handle special characters in the conditions

    Hi all,
    We have a table for colour codes and there related information but the colour codes have special characters in them like
    AL&.MPD
    CH(SB00
    ECA&BC1
    TD..0023
    0O'DON4
    i need to check if these exist in the table or not but when i query like
    select * from art.tb_color_code where color_code in ('AL&.MPD','CH(SB00','ECA&BC1','TD..0023','0O'DON4');
    i get prompts for entering the variable values there are 2500 such codes
    how do i negate the special meanings of these characters
    Regards
    Maverick

    Hi,
    If a string literal contains an apostrophe, use two consecutive apostrophes.
    For example:
    '0O''DON4'is a seven-character string. The third character is an apostrophe.
    As others have said,
    SET   DEFINE  OFFwill disable the special meaning of & in SQL*Plus.

  • HTTP-RFC(BPM)-FILE Scenario

    I have a problem on using the 'http-RFC(BPM)-File scenario'. When i enter values using the  Client http adapter, it displays message telling that "BPE_ADDAPTER.SYNCHONOUS_MESSAGE"
    The error msg is displayed below:
    Result:  
    <SAP:Error>
    <SAP:Category>XIAdapter</SAP:Category>
    <SAP:Code>BPE_ADAPTER.SYNCHONOUS_MESSAGE</SAP:Code>
    <SAP:Stack>The process does not support the given synchronous interface or does not support synchronous messages</SAP:Stack>
    </SAP:Error>
    Also in SAP XI monitor, the sender services along with the corresponding sender interfaces.
    Expecting this prob will be off soon.
    thanks
    vinod v

    Hi Vinod,
    your process is asynchronous (no sync async bridge). But you send "Quality of Service = Best Effort" (Url paramater qos=BE). You should send "Exactly Once" (EO).
    Regards,
    Udo

  • Connection String Special char

    Hello,
    I have a problem with databasenames with special characters in the name:
    (My code works when there is not a special char in the name)
    For example, when my connectionstring would be:  jdbc:sybase:Tds:localhost:2638?ServiceName=BANDENM&W
    I get a java.sql.SQLException: JZ00L: Login failed.  Examine the SQLWarnings chained to this exception for the reason(s). at line 3 while my pasw and login are correct.
    Class.forName("com.sybase.jdbc3.jdbc.SybDriver");
      String connectionString = "jdbc:sybase:Tds:" + config.getHost() + ":" + config.getPort() + "?ServiceName=" + databaseName;
      Connection connection2  = DriverManager.getConnection(connectionString, config.getUser(), config.getPassword());
      //get VC client customer info
      statement = connection2.createStatement();
      resultSet2 = statement.executeQuery("SELECT CNR_SUPP,CNR_CUST,TNR_ID,NM_ID,CNR_VAT_ID,NM_FILTER_ID,CNR_ZIP_ID,CNR_VATCNTRY_ID,NM_TOWN_ID,TOP_COUNTRY.CNR_INTRASTAT FROM TOP_IDENTITY JOIN TOP_COUNTRY ON (TOP_IDENTITY.COD_CNTRY_ID = TOP_COUNTRY.COD_CNTRY)");
    When I add double quotes around the databaseName, I get to line 8 but then I get an error:
    com.sybase.jdbc3.jdbc.SybSQLException: ASA Error -141: Table 'TOP_IDENTITY' not found
    But the table is again, definitely there ...
    I've tried escaping it by replacing & with &amp;
    But no luck.

    1) What version and build are you running for jConnect and SQL Anywhere?
    I’ve used jconn2 and jconn3, for the moment I’m using 3
    SQL Anywhere = 9.0.2.3198 on my developer system
    2) Can you post the output from dbinfo for the database that you testing?
    I'm assuming you mean this:
    Adaptive Server Anywhere Database Engine Version 9.0.2.3198
    Copyright © 1989-2004 Sybase, Inc.
    Portions Copyright © 2002-2004, iAnywhere Solutions, Inc.
    All rights reserved. All unpublished rights reserved.
    This software contains confidential and trade secret information of
    iAnywhere Solutions, Inc.
    Use, duplication or disclosure of the software and documentation
    by the U.S. Government is subject to restrictions set forth in a license
    agreement between the Government and iAnywhere Solutions, Inc. or
    other written agreement specifying the Government's rights to use the
    software and any applicable FAR provisions, for example, FAR 52.227-19.
    iAnywhere Solutions, Inc., One Sybase Drive, Dublin, CA 94568, USA
    4 logical processor(s) on 1 physical processor(s) detected.
    Running on Windows NT 6.1 Build 7601 Service Pack 1
    21688K of memory used for caching
    Minimum cache size: 2048K, maximum cache size: 262144K
    Using a maximum page size of 8192 bytes
    Database server started at Wed Aug 27 2014 14:18
    Trying to start SharedMemory link ...
        SharedMemory link started successfully
    Trying to start NamedPipes link ...
        NamedPipes link started successfully
    Trying to start TDS (TCPIP) link ...
    Starting on port 2638
        TDS (TCPIP) link started successfully
    Now accepting requests
    Starting database "TOPADMINSA9" (W:\TOP\DATA\TOPADMINSA9.db) at Wed Aug 27 2014 14:18
    Transaction log: TOPADMINSA9.log
    Starting checkpoint of "TOPADMINSA9" (TOPADMINSA9.db) at Wed Aug 27 2014 14:18
    Finished checkpoint of "TOPADMINSA9" (TOPADMINSA9.db) at Wed Aug 27 2014 14:18
    Database "TOPADMINSA9" (TOPADMINSA9.db) started at Wed Aug 27 2014 14:18
    Starting database "3051" (w:\TOP\DATA\3051\3051.DB) at Wed Aug 27 2014 14:18
    Starting checkpoint of "3051" (3051.DB) at Wed Aug 27 2014 14:18
    Finished checkpoint of "3051" (3051.DB) at Wed Aug 27 2014 14:18
    Database "3051" (3051.DB) started at Wed Aug 27 2014 14:18
    Starting database "BANDENM&W" (w:\TOP\DATA\BANDENM&W\BANDENM&W.DB) at Wed Aug 27 2014 14:19
    Database "3051" (3051.DB) stopped at Wed Aug 27 2014 14:19
    Starting checkpoint of "BANDENM&W" (BANDENM&W.DB) at Wed Aug 27 2014 14:19
    Finished checkpoint of "BANDENM&W" (BANDENM&W.DB) at Wed Aug 27 2014 14:19
    Database "BANDENM&W" (BANDENM&W.DB) started at Wed Aug 27 2014 14:19
    Starting database "BRAL" (w:\TOP\DATA\BRAL\BRAL.DB) at Wed Aug 27 2014 14:19
    Transaction log: w:\TOP\DATA\BRAL\BRAL.log
    Starting checkpoint of "BRAL" (BRAL.DB) at Wed Aug 27 2014 14:19
    Finished checkpoint of "BRAL" (BRAL.DB) at Wed Aug 27 2014 14:19
    Database "BRAL" (BRAL.DB) started at Wed Aug 27 2014 14:19
    Starting checkpoint of "BRAL" (BRAL.DB) at Wed Aug 27 2014 14:19
    Finished checkpoint of "BRAL" (BRAL.DB) at Wed Aug 27 2014 14:19
    Database "BRAL" (BRAL.DB) stopped at Wed Aug 27 2014 14:19
    Starting database "HARKELIJN" (w:\TOP\DATA\HARKELIJN\HARKELIJN.DB) at Wed Aug 27 2014 14:19
    Transaction log: w:\TOP\DATA\HARKELIJN\HARKELIJN.log
    Starting checkpoint of "HARKELIJN" (HARKELIJN.DB) at Wed Aug 27 2014 14:19
    Finished checkpoint of "HARKELIJN" (HARKELIJN.DB) at Wed Aug 27 2014 14:19
    Database "HARKELIJN" (HARKELIJN.DB) started at Wed Aug 27 2014 14:19
    Starting checkpoint of "HARKELIJN" (HARKELIJN.DB) at Wed Aug 27 2014 14:19
    Finished checkpoint of "HARKELIJN" (HARKELIJN.DB) at Wed Aug 27 2014 14:19
    Starting database "BURO56" (w:\TOP\DATA\BURO56\BURO56.DB) at Wed Aug 27 2014 14:19
    Database "HARKELIJN" (HARKELIJN.DB) stopped at Wed Aug 27 2014 14:19
    Transaction log: w:\TOP\DATA\BURO56\BURO56.log
    Starting checkpoint of "BURO56" (BURO56.DB) at Wed Aug 27 2014 14:19
    Finished checkpoint of "BURO56" (BURO56.DB) at Wed Aug 27 2014 14:19
    Database "BURO56" (BURO56.DB) started at Wed Aug 27 2014 14:19
    Starting checkpoint of "BURO56" (BURO56.DB) at Wed Aug 27 2014 14:19
    Finished checkpoint of "BURO56" (BURO56.DB) at Wed Aug 27 2014 14:19
    Database "BURO56" (BURO56.DB) stopped at Wed Aug 27 2014 14:19
    Starting database "ENOZEN" (w:\TOP\DATA\ENOZEN\ENOZEN.DB) at Wed Aug 27 2014 14:19
    Transaction log: w:\TOP\DATA\ENOZEN\ENOZEN.log
    Starting checkpoint of "ENOZEN" (ENOZEN.DB) at Wed Aug 27 2014 14:19
    Finished checkpoint of "ENOZEN" (ENOZEN.DB) at Wed Aug 27 2014 14:19
    Database "ENOZEN" (ENOZEN.DB) started at Wed Aug 27 2014 14:19
    Starting checkpoint of "ENOZEN" (ENOZEN.DB) at Wed Aug 27 2014 14:19
    Finished checkpoint of "ENOZEN" (ENOZEN.DB) at Wed Aug 27 2014 14:19
    Database "ENOZEN" (ENOZEN.DB) stopped at Wed Aug 27 2014 14:19
    Starting database "ENOCONBVBA" (W:\TOP\DATA\ENOCONBVBA\ENOCONBVBA.DB) at Wed Aug 27 2014 14:19
    Transaction log: W:\TOP\DATA\ENOCONBVBA\ENOCONBVBA.LOG
    Starting checkpoint of "ENOCONBVBA" (ENOCONBVBA.DB) at Wed Aug 27 2014 14:19
    Finished checkpoint of "ENOCONBVBA" (ENOCONBVBA.DB) at Wed Aug 27 2014 14:19
    Database "ENOCONBVBA" (ENOCONBVBA.DB) started at Wed Aug 27 2014 14:19
    Starting checkpoint of "ENOCONBVBA" (ENOCONBVBA.DB) at Wed Aug 27 2014 14:19
    Finished checkpoint of "ENOCONBVBA" (ENOCONBVBA.DB) at Wed Aug 27 2014 14:19
    Database "ENOCONBVBA" (ENOCONBVBA.DB) stopped at Wed Aug 27 2014 14:19
    3) Can you run the following queries within the application that you are seeing this behavior and provide the results:
      Q1:
         select  user_name,  table_name
              from  systable join sysuser
         where
               table_name in ('TOP_IDENTITY','TOP_COUNTRY')
    27-08-14 14:23:30 [ERROR] TechLogger -  -> com.sybase.jdbc3.jdbc.SybSQLException: ASA Error -141: Table 'sysuser' not found
    Q2:
         select current user from dummy;
    resultSet2.getString("current user")" = DBA

  • 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 to specify a variable in the path prefix of an External HTTP (RFC) connection (in transaction SM59)

    Hi There,
    Please can someone tell me how to specify a variable in the  path prefix of an External HTTP (RFC) connection in transaction SM59?
    For example if my path prefix is /invoke/test/example?input=XYZ; how do I replace "XYZ" with a variable so that I can pass in any value after "=" ?
    Thanks,
    Brendon

    Hi,
    This is SAP Business one system administration forum. Please find correct forum and repost above discussion to get quick assistance.
    Please close this thread here with helpful answer.
    Thanks & Regards,
    Nagarajan

  • Special Char disappear after the JMS Adpater

    Hi all,
    I have a problem and nees help because I don't know the solution.
    We send a flat Idoc via a JMS Adapter from XI to a Websphere Queue.
    The flat Idocs have special chars like "ø", "ö", "ä"...
    Unforunately in the message on the queue (after the JMS adapter) we miss this chars and one char behind the special char. They are away.
    In XI I can see that the char are there.
    So I think the that JMS adapter removes this files.
    Can you help me please? What do I need to change in the JMS adapter?
    Thanks and regards
    Manuela

    sounds like an encoding problem. Seems there is a way to change the encoding at the JMS receiver side.
    Have a look at this thread : Re: Change encoding from utf-8 to iso-8859-1 in JMS receiver!

  • AFCS.java doesn't handle the http redirect request

    Hi AFCS team,
         I just tried out the java script for external authentication. By default, when calling new AFCS.AccountManager(accountURL);, I'll get an error like the following:
    "GET http://connectnow.acrobat.com/myaccount?mode=xml&accountonly=true& failed with status 302";
         Actually this url will be redirected to "https://na2.connectnow.acrobat.com/myaccount?mode=xml&accountonly=true&" for me.
         However,  the script handles the http response only when status=200, or it consider the status as error.
         So I added following code to http_get()/http_post(), everything goes well so far.
                if (responseCode == 200) {
                    return connection.getInputStream();
                // handle the redirect status
                else if (responseCode == 302) {
                    return http_get(connection.getHeaderField("Location"), headers);
                else {
                   throw new Error();
         Is it something need to be fixed in next release?
    Thanks!
    Jinni

    So, the code was there a couple of releases ago, and then I took it out because I noticed that the lower level API were already processing redirections (but at this point I don't know on which case)
    I'll do some more testing and if needed add the code back. Thanks for pointing it out!

  • Handle special character in mapping

    Hi Experts,
    I have requirement to handle special character in mapping.
    ö this tiny special charcter comes in I/O file and we cant avoid.
    Refering the given blog:  http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9420 [original link is broken]
    FILE --- XI --- FILE where Source and target structures are same, using 1:1 mapping with FCC at both the side..
    Input/Output files consist of special charcters ö due to which getting error in mapping.
    Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0x13(:main:, row:8237, col:22) com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0x13(:main:, row:8237, col:22) at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:157) at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:73) at java.lang.Thread.run(Thread.java(Compiled Code))
    Do we required Java mapping? Is there any other way to acheive wtihout using Java mapping?
    How can we hadle in mapping?
    Sameer

    ö this tiny special charcter comes in I/O file and we cant avoid.
    Refering the given blog:  http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9420 [original link is broken]
    What has an ö to do with an ampersand?
    Assign the correct encoding to the file adapter channel.

  • Handle special characters in xml

    Hi,
      Our end users tend to copy the description text from Word documents to pdf form and submits it.
    If that text contains any special characters, its getting carried to the extracted xml. In the next step, when I try to assign a task to user with template and this xml, Managers cannot able to open the form and showing the error. When I assign the xml without special characters, its running fine.
    Please assist on how to handle this?
    My expectation is that user should be prompted in the form when he pastes any special characters or they should be auto-corrected to null values. if that is not possible, atleast we should able to filter the xml and eliminate special characters before the form go to next stage.
    Appreciate your help.
    Thanks,
    Krishna

    In first instance, I would have followed this way:
    http://www.dvteclipse.com/documentation/svlinter/How_to_use_special_characters_in_XML.3F.h tml
    so, I would have parsed the submitted text in a Validate event and changed any special chars to UTF-8 numeric reference.
    However, I found this:
    http://blog.mark-mclaren.info/2007/02/invalid-xml-characters-when-valid-utf8_5873.html
    which seems to state that not all UTF-8 characters are possible in XML.
    In fact, those allowed are listed here:
    http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char
    so, I would still use a Validate event script but based on the XML specs' Character Range. Exactly as Mark McLaren did in Java.
    This will permit to keep those special chars that are allowed. Your Managers will thank you.
    Hope it helps.

Maybe you are looking for

  • I can't watch videos on Nokia X2-01?

    Just now, I tried to watch a YouTube video on the phone but it say 'Subscribe to Packet Data First'. What does that mean? By the way, it usually works.

  • 1.0.3 Upgrade problem

    When trying to install this upgrade, I get a message that the "Digital Signature for this Package is incorrect." I removed FCS System ID file and re-entered the s/n but that didn't help. Any ideas? Thanks... STP   Mac OS X (10.4.4)  

  • Serial number for Photoshop CC

    I have never received a serial number after I paid for subscription for Photoshop CC. The Application run very well. Some places i have read that the serial number is mailed right after the payment is fullfilled. Do other users in this forum also not

  • Performance in ESS and MSS

    Dear Expert, Is there any specific performance recommendations for ESS/MSS content being accessed over WAN. Best Regards, Deepak..

  • No more than 10 client computers appear in WSUS 3.0 Admin Console

    Hi Folks, I installed WSUS 3.0 SP1 on our SBS 2003 R2 Premium server a few days ago. I've noticed that the WSUS admin console will never display more than 10 client computers at a time. In fact, I've got roughly 16 clients that get used daily. I've u