Reading String Data

Am quite new to java and having trouble with the syntax.
Using package java.net, I am trying to read the output of an http client. I can echo the ouptut to screen but prefer not to do that.
I tried the following but it sometimes raises an eInvalidPointer exception, and the compiler indicates that the string array resp may not be initialized.
Would appreciate an idea of the best way to read the returned data from this http client.
import java.net.*;
import java.io.*;
import java.util.*;
class GetAvgLatency{
public static void connectAndGet( String targetURL ){
String dataLine;
String[] resp;
try{
URL url = new URL( targetURL );
//Open a connection to the URL and get a URLConnection object.
URLConnection urlConnection = url.openConnection();
//Use the connection to get an InputStream object.
// Use the InputStream object to instantiate a DataInputStream object.
     BufferedReader htmlPage =
     new BufferedReader(new InputStreamReader(url.openStream()));
//Use the DataInputStream object to read and store the received data one line at a time.
int i = 0;
while((dataLine = htmlPage.readLine()) != null){
     resp[ i ] = dataLine;
     i++;
} //end while loop
} //end try
catch(UnknownHostException e){
System.out.println(e);
System.out.println("Must be online to run properly.");
} //end catch
catch(MalformedURLException e){System.out.println(e);}
catch(IOException e){System.out.println(e);}
} //connectAndGet
public static void main(String[] args){
String TheHost;
int imax = 100;
long t0, t1, deltaT;
long sum = 0;
float avg;
// if ( args == null )
TheHost = "Http://icmicronjwc/scripts/runisa.dll?eroicaLT:pgloadtest1";
// else     
//      TheHost = args[ 0 ];
System.out.println( "Testing " + TheHost );
System.out.println( "" );
for ( int i = 0; i < imax; i++ ){
t0 = System.currentTimeMillis();          
connectAndGet( TheHost );
t1 = System.currentTimeMillis();          
deltaT = t1 - t0;
System.out.print( i + " " + deltaT + " " );
sum += deltaT;
System.out.println( "" );
System.out.println( "" );
avg = sum/imax;
System.out.println( "average app latency for " + imax +
" requests is " + avg + " ms" );
} //end main
} //end class HttpTest
tks,
jwc

You should create your array this way : String[] resp = new String[10]. If not, the compiler complains that it is not initialized.
But this methods is not good. To store your strings, you should use a Vector, LinkedList or whatever you want, because you don't know how many lines you are going to store :
Vector resp = new Vector();
while((dataLine = htmlPage.readLine()) != null){
resp.add(dataLine);
i++;
} //end while loop

Similar Messages

  • How to read a data file combining strings and data

    Hello,
    I'm having a data file combining strings and datas to read. I'm trying to read the filename, time, constants and comments into four seperate string indicators (the lines for the comments varies for different files). And read the data into a 2-D numeric array. How can I do this? Is there any function that can serch special characters in the spreadsheet file so I can exactly locate where I should start reading the specific data. The following is how the data file appears. Thank you very much.
    Best,
    Richard
    filename.dat
    14:59:00 12/31/2009
    Sample = 2451
    Frequency = 300, Wait time = 2500
    Temperature = 20
    some comments
    some comments
    some comments
    some comments
    some comments
    7.0000E+2    1.5810E-5
    7.0050E+2    1.5400E-5
    7.0100E+2    1.5500E-5
    7.0150E+2    1.5180E-5
    Message Edited by Richard1017 on 10-02-2009 03:10 PM
    Solved!
    Go to Solution.

    Hi,
         I'm fairly new to the NI forums too and I think you just have to wait longer.  Your post was done right.  I do a similiar function as to what you are talking about except I read in numbers from a file.  I create an ini file (just a notepad file of type *.ini) that is is set up with sections inside brackets [] and keys with whatever name followed by an = sign.  You may be able to use a *.dat file too, I just haven't.  Then the vi attached goes to that file and reads the keys from those sections.  You just repeat for the different sections and keys you want to read.  You can use similar provide VI's to write to that same file or create it.  Let me know how that works. 
    Attachments:
    Help1.ini ‏1 KB
    Help1.vi ‏10 KB

  • I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?

    I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?
    Attachments:
    try2.txt ‏2 KB
    read_array.vi ‏21 KB

    The problem is in the delimiters in your text file. By default, Read From Spreadsheet File.vi expects a tab delimited file. You can specify a delimiter (like a space), but Read From Spreadsheet File.vi has a problem with repeated delimiters: if you specify a single space as a delimiter and Read From Spreadsheet File.vi finds two spaces back-to-back, it stops reading that line. Your file (as I got it from your earlier post) is delimited by 4 spaces.
    Here are some of your choices to fix your problem.
    1. Change the source file to a tab delimited file. Your VI will then run as is.
    2. Change the source file to be delimited by a single space (rather than 4), then wire a string constant containing one space to the delimiter input of Read From Spreadsheet File.vi.
    3. Wire a string constant containing 4 spaces to the delimiter input of Read From Spreadsheet File.vi. Then your text file will run as is.
    Depending on where your text file comes from (see more comments below), I'd vote for choice 1: a tab delimited text file. It's the most common text output of spreadsheet programs.
    Comments for choices 1 and 2: Where does the text file come from? Is it automatically generated or manually generated? Will it be generated multiple times or just once? If it's manually generated or generated just once, you can use any text editor to change 4 spaces to a tab or to a single space. Note: if you want to change it to a tab delimited file, you can't enter a tab directly into a box in the search & replace dialog of many programs like notepad, but you can do a cut and paste. Before you start your search and replace (just in the text window of the editor), press tab. A tab character will be entered. Press Shift-LeftArrow (not Backspace) to highlight the tab character. Press Ctrl-X to cut the tab character. Start your search and replace (Ctrl-H in notepad in Windows 2000). Click into the Find What box. Enter four spaces. Click into the Replace With box. Press Ctrl-V to paste the tab character. And another thing: older versions of notepad don't have search and replace. Use any editor or word processor that does.

  • The "write key" configurat​ion file vi use of "trim string" prior to writing the data can modify any string data written.

    I tried to use the config VIs to record some front-panel settings for later restoration, one of which could be a single space character (part of a string parsing system).
    I soon discovered that whenever I tried to save that single-space value to an INI file, only a null string was saved.
    After doing some digging I discovered that buried in the Write Key vi is a worker vi called Config Data Modify that uses Trim String on the string data before it is written to the file and that's what was eating my string character. I don't know whether this is a bug or a feature but there are at least three ways to fix it.
    1) Assuming you want to leave the library VIs alone, you can pre-process any stings sent to "write key" to replace all spaces with "\20" and then post-process all strings read using "read key" to replace all instances of \20 with spaces.
      and if you don't mind modifying the library VIs, either to save/use under a different name or to stick back into the library in a modified state (caution - can cause problems when you move code to another machine with an un-modified library) then...
    2) You can yank the trim-string out of the Config Data Modify vi and hope that it does not have any undesirable side effects with regards to the other routines that use Config Data Modify (so far I have not found any in my limited testing)
    or
    3)  You can modify the string pre-processing vi, Remove Unprintable Chars, to add the space character to the list of characters that get swapped out automatically.
    Note that both option #1 (as suggested above) and option #3 will produce an INI file data entry that looks like    key="\20Hello\20World\20"   while option #2 produces an entry that looks like   key=" Hello World "
    The attached PDF contains screenshots of all this.
    Attachments:
    Binder1.pdf ‏2507 KB

    Hi Warren,
    there's a 4th option:
    Simply set the "write raw string" input of the write key function to TRUE
    This option only appears when a string is wired to that function!
    Just re-checked:
    I think it's a limitation of the config file format. It's text based and (leading) spaces in the value are "overseen" as whitespaces. So your next option would be to use quotes around your string with spaces...
    Message Edited by GerdW on 05-02-2009 08:32 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Need to convert string data to numbers.

    I have string data that I need to convert to numbers so that I can graph it or perform calculations on it. The data (file attached) is in three columns (tab separated) and is in the format time/double/time (saved as a string with Write haracters to File.) When I try Read From Spreadsheet I get 0.0000 for column 1 and 2.0000 for column 3.
    Attachments:
    testOK.txt ‏1 KB

    Hi,
    I've done this through scan from file, using %s%f%s%s so I get the relative time, numeric, time, PM
    See the attached .vi.
    Hope it helps
    S.
    // it takes almost no time to rate an answer
    Attachments:
    disect_data.vi ‏46 KB

  • How to read the data in excel sheet

    Dear sir,
    How to read the data in excel sheet when i recieve a data serial communication... ie i have store a data in excel such that
    Cell A       Cell B
       A           Apple 
       B           Ball
       C           Cat
       D           Doll
    when i recieve A from serial communication i have to display Apple, and when i recieve B i have to display Ball and so on.. 

    Hi, 
    I would recommend you to have a look at the VI attached. It makes use of a VI named 'Read from Spreadsheet' to read the row and column data from the tab delimited excel file. The read data is then searched for the Alphabet specified and finally returns you the corresponding string. The test file used to validate the operation of the VI is also attached. 
    Trust this would help you solve the issue. 
    Regards, 
    Sagar G Yadav | Application Engineer | National Instruments
    Attachments:
    read_from_excel.vi ‏10 KB
    Book1.txt ‏1 KB

  • Reading Unicode data from a file...

    I am writing an application that needs to read some configuration data from a file. An end user edits the configuration file to provide the configuration data. The Java code reads this file and uses the configuration data supplied by the user.
    The user can also save non-ascii characters as part of the configuration data. hence, I do not want to use java properties files. What are the other options available that allow me reading Unicode data into my Java code and will also allow user to save the configuration file as Unicode?

    Java characters are Unicode characters. Read file data that consists of Unicode characters as Java characters or strings.
    You can read the data as primitive char values using the DataInputStream class. The InputStreamReader class can also read Unicode (UTF-16) data.
    Data can be written using the OutputStreamWriter class.

  • How to read XML data stored in CLOB in Concurrent prog Output

    Hi All,
    I'm trying to Generate the XML Data as concurrent Program output. I have a PL/SQL package which generated the XML data by using SQL/XML functions. I'm storing the generated XML data in a CLOB variable. But when i try to read the data using fnd_file.put_line(fnd_file.OUTPUT,XML_Data) it doesn't display data more than 32767 bytes.
    Please help me out to understand what could be done to read the data in chunks. I have tried many logic's to print chunks of data but the output tags are either chopped off and errors out saying Tag not found.
    My logic is as below:
    v_handler:= DBMS_XMLGEN.newContext(v_xml_query);
    --Sets NULL handling options
    DBMS_XMLGen.SetNullHandling(v_handler, dbms_xmlgen.EMPTY_TAG ) ;
    --Set special character handling
    DBMS_XMLGEN.setConvertSpecialChars(v_handler, TRUE);
    -- Specified whether to use an XML attribute to indicate NULLness of particular entity in the XML document
    DBMS_XMLGen.useNullAttributeIndicator(v_handler,TRUE);
    -- set Checking invalid chars
    DBMS_XMLGEN.setCheckInvalidChars(v_handler, TRUE);
    -- get the xml data as required
    v_xml_data:= DBMS_XMLGEN.getXMLtype(v_handler);
    SELECT XMLROOT(v_xml_data.extract('/*'),VERSION '1.0').getClobVal() into v_new_xml_Data from dual;
    -- get the length of the xml generated
    v_clob_len := dbms_lob.getlength(v_new_xml_Data);
    FND_FILE.PUT_LINE(FND_FILE.LOG,'The Clob length is :'|| v_clob_len);
    -- logic to process string more than 32767 Processing by each character
    v_offset :=1;
    while (v_offset <= v_clob_len)
    LOOP
    v_char := dbms_lob.substr(v_new_xml_Data, 1, v_offset);
    IF (v_char = CHR(10))
    then
    fnd_file.new_line(fnd_file.output, 1);
    else
    fnd_file.put(fnd_file.output, v_char);
    end if;
    v_offset := v_offset + 1;
    END LOOP;
    FND_FILE.PUT_LINE(FND_FILE.LOG,'The offset is :'|| v_offset);
    FND_FILE.NEW_LINE(FND_FILE.OUTPUT, 1);
    THe above logic is for character by character which is a performance burden? Please let me know if there is any other work around for this

    Hi,
    Thanks for Replying. I have refered http://blog.oraclecontractors.com/?p=69 and then i added that piece of code. Basically, i'm trying to generate a report using XML publisher. To generate the XML data i'm writing a pl/sql package with SQl/XML functions. DBMS_XMLGEN would help me convert the XML Data as is. When the concurrent program runs this XML data will merge with RTF layout and generate required report. I'm able to generate the Report for data less then 32767 bytes. More than the limit i need to pass chunks of XML data to read as output. That's the reason i'm using fnd_file.output. But it reads only 32767 size at a time.
    WHen i use the given logic, it works perfectly fine, but it loops for each character, for example if you have 30,000 characters it loops the same, which is peformance burden.
    So i tried to write the logic of chunks but still i get the error that XML tag is not found or missing. I'm hoping this is very common issue, but after all my trails, i didn't find the right solution.
    the other logic i tried was :
    v_new_xml_data varchar2(32767)
    v_iterations := CEIL(v_clob_len/v_chunk_length); -- v_chunk_length is 32767 and v_clob_length is length of the XML data stored inthe clob variable
    For i in 0..v_iterations
    LOOP
    FND_FILE.put_line (fnd_file.log,'the loops v_pos :'||i||' and v_clob_length :'||v_clob_len);
    v_new_xml_data := DBMS_LOB.SUBSTR ( V_XML_DATA,v_chunk_length,(i*v_chunk_length)+1);
    FND_FILE.PUT_LINE (FND_FILE.OUTPUT,v_new_xml_data); -- read the output for every 32767 chunks
    FND_FILE.PUT_LINE(FND_FILE.LOG, 'Chunk length is :'||((i*v_chunk_length)+1));
    END LOOP;
    FND_FILE.put_line (fnd_file.log,'out of loop');
    FND_FILE.put_line (fnd_file.log,'length of new xml is '||v_clob_len);
    Please, let me know if you need Further clarifications on the same.

  • Reading XML Data from ABAP Program?

    Hi,
    How do I read XML Data from an ABAP Program? For example if I have the below basic XML Code-
    <xml>
    <Name> Thiru </Name>
    <Age> 24 </Age>
    <City> chennai </Chennai>
    </xml>
    How do i read the data within the Name,Age, and City tags into variables in the ABAP Program?
    Regards,
    Thiru

    if you decide to do in XSLT, I have a sample list here:
    XML file like this:
    <?xml version="1.0" encoding="UTF-16"?>
    <F>
    <P1>
    <t_1>value1</t_1>
    <t_2>testvalue</t_2>
    </P1>
    <P2>
    </P2>
    </F>
    XSLT file like this:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sapxsl="http://www.sap.com/sapxsl" version="1.0">
    <xsl:strip-space elements="*"/>
    <xsl:template match="F">
    <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
    <asx:values>
    <<b>DOCUMENT</b>>
    <xsl:apply-templates/>
    </<b>DOCUMENT</b>>
    </asx:values>
    </asx:abap>
    </xsl:template>
    <xsl:template match="P1">
    <ENTRY>
    <<b>T_1</b>><xsl:value-of select="t_1"/></T_1>
    <<b>T_2</b>><xsl:value-of select="t_2"/></T_2>
    </ENTRY>
    </xsl:template>
    </xsl:transform>
    ABAP program like this:
    DATA: BEGIN OF wa_upload,
    text(255) TYPE c,
    END OF wa_upload,
    itab_upload LIKE TABLE OF wa_upload,
    BEGIN OF wa_document,
    t_1 TYPE string,
    t_2 TYPE string,
    END OF wa_document,
    itab_document LIKE TABLE OF wa_document.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = 'XXXXX'
    filetype = 'ASC'
    TABLES
    data_tab = itab_upload.
    CALL TRANSFORMATION zrappel_xml_test
    SOURCE XML itab_upload
    RESULT <b>document</b> = itab_document.
    You should pay attention to the bold words.
    hope it will be helpful
    thanks

  • String data size is limited?

    Hi, ABAPERs.
    I'm implementing, following several threads, the uploading of a XML via an XML stream prior to set a XSLT transformation. The problem is that most of the 'job' is doing based on data defined as strings, but the file is cutted in a certain length. The question is that I wanna know is that limit really exists or whether I have to do an alternative uploading process to succeed.
    Thanks for your helping.

    As you all may see, it's the code set in any previous thread with allows me to upload a binary file code up to get a XML. In spite the table line is set to (256 type x lenght), and there's an offset, even before of that it does not get the full file:
      types: begin of ty_xml_line,
             data(256) type x,
             end   of ty_xml_line.
      data:
        lv_ixml type ref to if_ixml,
        lv_stream type ref to if_ixml_stream_factory,
        lt_xml_table type table of ty_xml_line,
        lv_xml_line type ty_xml_line,
        lc_conv type ref to cl_abap_conv_in_ce,
        lv_xml_table_size type i,
        lv_len type i,
        lv_len2 type i,
        lt_tab type tsfixml,
        lv_content type string,
        lv_str1 type string.
    * Generation of XML Stream.
      clear: lv_ixml, lv_stream.
      lv_ixml = cl_ixml=>create( ).
      lv_stream = lv_ixml->create_stream_factory( ).
    * File Generic Management.
      open dataset p_fichero for input in binary mode.
      if not sy-subrc is initial.
    *   call method me->escribir_log( ).
        exit.
      else.
        do.
          read dataset p_fichero into lv_xml_line.
          if sy-subrc is initial.
            append lv_xml_line to lt_xml_table.
          else.
            exit.
          endif.
        enddo.
        close dataset p_fichero.
      endif.
    * Extract XML File Contents..
    * Convert from HEX to XML..
      describe table lt_xml_table.
      lv_xml_table_size = ( sy-tleng ) * ( sy-tfill ).
      loop at lt_xml_table into lv_xml_line.
        lc_conv = cl_abap_conv_in_ce=>create( input = lv_xml_line-data
                                              replacement = space
                                              encoding = 'UTF-8' ).
        lc_conv->read( importing data  = lv_content len = lv_len ).
        concatenate lv_str1 lv_content into lv_str1.
      endloop.
      lv_str1 = lv_str1+0(lv_xml_table_size).
      split lv_str1 at cl_abap_char_utilities=>cr_lf into table pt_contenido.
      loop at pt_contenido into lv_str1.
        replace all occurrences of cl_abap_char_utilities=>horizontal_tab
                                in lv_str1 with space.
        condense lv_str1.
      endloop.
    As said before, is a very standard code.
    Best Regards.

  • Xy graph in GUI. Show string data related to a X,Y point

    It is possible to show string data, while hovering the mouse or clicking a cursor, attached/related to a X,Y point in a XY graph??
    Kind regards

    I assume you want to let the x-y-value pair hover over the graph at mouse position.Perhaps this will help you:
    http://forums.ni.com/t5/LabVIEW/Text-overlay-annotation-onto-an-intensity-graph/m-p/883438/highlight...
    Another option might be just to use the cursor functionalities of XY graphs, although they don't hover at mouse position.
    Other than that I had a similar request on Image Displays with IMAQ (Vision Development Module) where it turned out that using a simple string control from the classic palette that you move around according to mouse position is an efficient way to let information hover wherever you want. Check it out:
    http://forums.ni.com/t5/LabVIEW/Why-do-overlays-take-so-much-longer-on-single-precision/m-p/2376338#...

  • File Adapter fixed length Native format Builder schema not reading the data as expected

    Hi
    We are using a File Adapter for reading a fixed length data. Using the schema we are able to read the file but the places are incorrect. Following is the schema that we used and the payload.
    At the last you can find our expected read of data how it should be.
    With out the record type code we are not even reading the file. Hope there should be a correction in the schema. Please suggest
    Schema that we are using:
    <?xml version= '1.0' encoding= 'UTF-8' ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
         xmlns:tns="http://xmlns.energy.com/CreateReturnedItemGENVNDRPReqABCSImplFileAdapterReadReturnedItem"
         targetNamespace="http://xmlns.energy.com/CreateReturnedItemGENVNDRPReqABCSImplFileAdapterReadReturnedItem"
         elementFormDefault="qualified" attributeFormDefault="unqualified" nxsd:version="NXSD" nxsd:stream="chars"
         nxsd:encoding="US-ASCII">
        <xsd:element name="GENVNDRReturnedItem">
            <xsd:complexType>
                <xsd:sequence minOccurs="1" maxOccurs="unbounded" nxsd:choiceCondition="fixedLength" nxsd:length="1">
                    <xsd:element name="HeaderRec" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:startsWith="1">
                        <xsd:complexType>
                            <xsd:sequence>
                                <xsd:element name="RecordTypeCode" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="1" nxsd:padStyle="tail"/>
                                <xsd:element name="PriorityCode" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="2" nxsd:padStyle="tail"/>
                                <xsd:element name="ImmediateDstn" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="10" nxsd:padStyle="tail"/>
                                <xsd:element name="ImmediateOrgin" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="10" nxsd:padStyle="tail"/>
                                <xsd:element name="FileCrDt" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="6" nxsd:padStyle="tail"/>
                                <xsd:element name="FileCrTm" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="4" nxsd:padStyle="tail"/>
                                <xsd:element name="FileIdMdfr" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="1" nxsd:padStyle="tail"/>
                                <xsd:element name="RecSize" type="xsd:string" nxsd:style="fixedLength" nxsd:length="3"
                                     nxsd:padStyle="tail"/>
                                <xsd:element name="BlockingFctr" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="2" nxsd:padStyle="tail"/>
                                <xsd:element name="FormatCd" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="1" nxsd:padStyle="tail"/>
                                <xsd:element name="ImmediateDstnNm" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="23" nxsd:padStyle="tail"/>
                                <xsd:element name="ImmediateOrginNm" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="23" nxsd:padStyle="tail"/>
                                <xsd:element name="RefCd" type="xsd:string" nxsd:style="fixedLength" nxsd:length="8"
                                     nxsd:padStyle="tail"/>
                            </xsd:sequence>
                        </xsd:complexType>
                    </xsd:element>
                    <xsd:element name="BatchHdrRec" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:startsWith="5">
                        <xsd:complexType>
                            <xsd:sequence>
                                <xsd:element name="RecordTypeCode" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="1" nxsd:padStyle="tail"/>
                                <xsd:element name="ServClsCode" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="3" nxsd:padStyle="tail"/>
                                <xsd:element name="CmpnyName" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="16" nxsd:padStyle="tail"/>
                                <xsd:element name="CmpnyDiscretionaryData" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="20" nxsd:padStyle="tail"/>
                                <xsd:element name="CmpnyIdfn" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="10" nxsd:padStyle="tail"/>
                                <xsd:element name="StdClsCode" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="3" nxsd:padStyle="tail"/>
                                <xsd:element name="CmpnyEntryDesc" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="10" nxsd:padStyle="tail"/>
                                <xsd:element name="CmpnyDescDate" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="6" nxsd:padStyle="tail"/>
                                <xsd:element name="EffEntryDate" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="6" nxsd:padStyle="tail"/>
                                <xsd:element name="SettlementDate" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="3" nxsd:padStyle="tail"/>
                                <xsd:element name="OrgntrStatusCode" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="1" nxsd:padStyle="tail"/>
                                <xsd:element name="OrgntrBatchCode" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="15" nxsd:padStyle="tail"/>
                            </xsd:sequence>
                        </xsd:complexType>
                    </xsd:element>
                    <xsd:element name="FileControlRec" nxsd:style="terminated" nxsd:terminatedBy="${eol}"
                         nxsd:startsWith="9">
                        <xsd:complexType>
                            <xsd:sequence>
                                <xsd:element name="RecordTypeCode" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="1" nxsd:padStyle="tail"/>
                                <xsd:element name="BatchCnt" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="6" nxsd:padStyle="tail"/>
                                <xsd:element name="BlockCnt" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="6" nxsd:padStyle="tail"/>
                                <xsd:element name="EntryAddendaCnt" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="8" nxsd:padStyle="tail"/>
                                <xsd:element name="EntryHash" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="10" nxsd:padStyle="tail"/>
                                <xsd:element name="TtlDbtEntryDlrAmt" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="12" nxsd:padStyle="tail"/>
                                <xsd:element name="TtlCrdtEntryDlrAmt" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="12" nxsd:padStyle="tail"/>
                                <xsd:element name="Reserved" type="xsd:string" nxsd:style="fixedLength"
                                     nxsd:length="39" nxsd:padStyle="tail"/>
                            </xsd:sequence>
                        </xsd:complexType>
                    </xsd:element>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
    </xsd:schema>
    Sample data:
    1011390714890 0910000191406110449A094101MCSCLDA_TESTIN    
    XPLLS KNRGO CNNK         
    5200MCSCLDA_TESTIN  e-Bill         
    2390714890TELe-Bill     
    1406100001091000017000001
    6262759774891010000074743
    0000033793102651-013  U  HOLBACH KARLA & JAMES   1091000013925011
    799R01091000013925011 
    27597748                                       
    091000010000001
    820000000200275977480000000337930000000000002390714890                    
    091000010000001
    9000060000025000001200995048661000001265867000000000000                                 
    Read File receive Activity:
    <GENVNDRReturnedItem>
      <HeaderRec>
        <RecordTypeCode>0</RecordTypeCode>
        <PriorityCode>11</PriorityCode>
        <ImmediateDstn>390714890</ImmediateDstn>
        <ImmediateOrgin>0910000191</ImmediateOrgin>
        <FileCrDt>406110</FileCrDt>
        <FileCrTm>449A</FileCrTm>
        <FileIdMdfr>0</FileIdMdfr>
        <RecSize>941</RecSize>
        <BlockingFctr>01</BlockingFctr>
        <FormatCd>M</FormatCd>
        <ImmediateDstnNm>CSCLDA_TESTIN X</ImmediateDstnNm>
        <ImmediateOrginNm>PLLS KNRGO CNNK</ImmediateOrginNm>
        <RefCd></RefCd>
      </HeaderRec>
      <BatchHdrRec>
        <RecordTypeCode>2</RecordTypeCode>
        <ServClsCode>00M</ServClsCode>
        <CmpnyName>CSCLDA_TESTIN e</CmpnyName>
        <CmpnyDiscretionaryData>-Bill 2</CmpnyDiscretionaryData>
        <CmpnyIdfn>390714890T</CmpnyIdfn>
        <StdClsCode>ELe</StdClsCode>
        <CmpnyEntryDesc>-Bill</CmpnyEntryDesc>
        <CmpnyDescDate>1</CmpnyDescDate>
        <EffEntryDate>406100</EffEntryDate>
        <SettlementDate>001</SettlementDate>
        <OrgntrStatusCode>0</OrgntrStatusCode>
        <OrgntrBatchCode>91000017000001</OrgntrBatchCode>
      </BatchHdrRec>
      <FileControlRec>
        <RecordTypeCode>0</RecordTypeCode>
        <BatchCnt>000600</BatchCnt>
        <BlockCnt>000250</BlockCnt>
        <EntryAddendaCnt>00001200</EntryAddendaCnt>
        <EntryHash>9950486610</EntryHash>
        <TtlDbtEntryDlrAmt>000012658670</TtlDbtEntryDlrAmt>
        <TtlCrdtEntryDlrAmt>00000000000</TtlCrdtEntryDlrAmt>
        <Reserved></Reserved>
      </FileControlRec>
    </GENVNDRReturnedItem>
    Expected Read data how we are looking:
    <GENVNDRReturnedItem>
      <HeaderRec>
        <RecordTypeCode>0</RecordTypeCode>
        <PriorityCode>11</PriorityCode>
        <ImmediateDstn>39071489</ImmediateDstn>
        <ImmediateOrgin>0091000019</ImmediateOrgin>
        <FileCrDt>140611</FileCrDt>
        <FileCrTm>0449</FileCrTm>
        <FileIdMdfr>A</FileIdMdfr>
        <RecSize>094</RecSize>
        <BlockingFctr>10</BlockingFctr>
        <FormatCd>1</FormatCd>
        <ImmediateDstnNm>MCSCLDA_TESTIN</ImmediateDstnNm>
        <ImmediateOrginNm>XPLLS KNRGO CNNK</ImmediateOrginNm>
        <RefCd/>
      </HeaderRec>
      <BatchHdrRec>
        <RecordTypeCode>2</RecordTypeCode>
        <ServClsCode>200</ServClsCode>
        <CmpnyName>MCSCLDA_TESTIN</CmpnyName>
        <CmpnyDiscretionaryData>e-Bill</CmpnyDiscretionaryData>
        <CmpnyIdfn>2390714890</CmpnyIdfn>
        <StdClsCode>TEL</StdClsCode>
        <CmpnyEntryDesc>e-Bill</CmpnyEntryDesc>
        <CmpnyDescDate/>
        <EffEntryDate>140610</EffEntryDate>
        <SettlementDate>000</SettlementDate>
        <OrgntrStatusCode>1</OrgntrStatusCode>
        <OrgntrBatchCode>091000017000001</OrgntrBatchCode>
      </BatchHdrRec>
      <FileControlRec>
        <RecordTypeCode>0</RecordTypeCode>
        <BatchCnt>000060</BatchCnt>
        <BlockCnt>000025</BlockCnt>
        <EntryAddendaCnt>00000120</EntryAddendaCnt>
        <EntryHash>0995048661</EntryHash>
        <TtlDbtEntryDlrAmt>000001265867</TtlDbtEntryDlrAmt>
        <TtlCrdtEntryDlrAmt>000000000000</TtlCrdtEntryDlrAmt>
        <Reserved/>
      </FileControlRec>
    </GENVNDRReturnedItem>

    at step 8 of 9 of the file adapter wizard, the icon appears as a cog, on the right, with caption "define schema for native format".
    I have JDev 11..1.1.3.0
    The problem might be with the version of the SOA extensions you have installed....

  • Need to read Hex data format for Handheld device. (SAP AII RFID )

    Hello,
    we developed a custom screens for packing, unpacking, tag commission.. etc for handheld device for my client. the Serial number field  type is /ain/barcode. Its working fine. but for the new system need to read the Hex format. I created a new field in the screen. but the handheld device is not reading the Serial number in Hex format.
    Could anyone suggest me how to read Hex data in Handheld devices. We are using Motorola MC9090 Series.
    Regards,
    Kamal

    Hi
    Are you using the reader to read an RFID tag or for reading barcodes.
    Ideally, if you read an EPC Gen2 RFID tag, for example, the 96 bit encoded EPC is read and that can be converted to its equivalent  HEX format for posting the observation to SAP AII.
    In case of barcodes, the string is read as is printed on the barcode.

  • Encoding problem while reading binary data from MQ-series

    Dear all,
    we are running on 7.0 and we have an encoding problem while reading binary data from MQ-series. Because we are getting flat strings from queue we use module "Plain2ML" (MessageTransformBean) for wrapping xml-elements around the incoming data.
    The MQ-Series-Server is using CCSID 850, which we configured in connection parameters in communication channel (both parameters for Queuemanager CCSID and also CCSID of target).If there are special characters in the message (which HEX-values differ from codepage to codepage) we get errors in our adapter while executing, please see stack-trace for further analysis below.
    It seems to us that
    1. method ByteToCharUTF8.convert() expects UTF-8 in binary data
    2. Both CCSID parameters are not used anyway in JMS-adapter
    How can we solve this problem without changing anything on MQ-site?
    Here is the stack-trace:
    Catching com.sap.aii.af.mp.module.ModuleException: Transform: failed to execute the transformation: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException caused by: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException
        at com.sap.aii.af.modules.trans.MessageTransformBean.throwModuleException(MessageTransformBean.java:453)
        at com.sap.aii.af.modules.trans.MessageTransformBean.process(MessageTransformBean.java:387)
        at com.sap.aii.af.mp.module.ModuleLocalLocalObjectImpl0_0.process(ModuleLocalLocalObjectImpl0_0.java:103)
        at com.sap.aii.af.mp.ejb.ModuleProcessorBean.process(ModuleProcessorBean.java:292)
        at com.sap.aii.af.mp.processor.ModuleProcessorLocalLocalObjectImpl0_0.process(ModuleProcessorLocalLocalObjectImpl0_0.java:103)
        at com.sap.aii.adapter.jms.core.channel.filter.SendToModuleProcessorFilter.filter(SendToModuleProcessorFilter.java:84)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.ConvertBinaryToXiMessageFilter.filter(ConvertBinaryToXiMessageFilter.java:304)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.ConvertJmsMessageToBinaryFilter.filter(ConvertJmsMessageToBinaryFilter.java:112)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.InboundDuplicateCheckFilter.filter(InboundDuplicateCheckFilter.java:87)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.TxManagerFilter.filterSend(TxManagerFilter.java:123)
        at com.sap.aii.adapter.jms.core.channel.filter.TxManagerFilter.filter(TxManagerFilter.java:59)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.DynamicConfigurationFilter.filter(DynamicConfigurationFilter.java:72)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.PmiAgentFilter.filter(PmiAgentFilter.java:66)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.InboundCorrelationFilter.filter(InboundCorrelationFilter.java:60)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.JmsHeadersProfileFilter.filter(JmsHeadersProfileFilter.java:59)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageInvocationsFilter.filter(MessageInvocationsFilter.java:89)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.JarmMonitorFilter.filter(JarmMonitorFilter.java:57)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.ThreadNamingFilter.filter(ThreadNamingFilter.java:62)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.SenderChannelImpl.doReceive(SenderChannelImpl.java:263)
        at com.sap.aii.adapter.jms.core.channel.ChannelImpl.receive(ChannelImpl.java:437)
        at com.sap.aii.adapter.jms.core.connector.MessageListenerImpl.onMessage(MessageListenerImpl.java:36)
        at com.ibm.mq.jms.MQMessageConsumer$FacadeMessageListener.onMessage(MQMessageConsumer.java:399)
        at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl$JmsProviderMessageListener.onMessage(JmsMessageConsumerImpl.java:904)
        at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageConsumer.receiveAsync(MQMessageConsumer.java:4249)
        at com.ibm.msg.client.wmq.v6.jms.internal.SessionAsyncHelper.run(SessionAsyncHelper.java:537)
        at java.lang.Thread.run(Thread.java:770)
    Caused by: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException
        at com.sap.aii.messaging.adapter.Conversion.service(Conversion.java:714)
        at com.sap.aii.af.modules.trans.MessageTransformBean.processTransform(MessageTransformBean.java:538)
        at com.sap.aii.af.modules.trans.MessageTransformBean.processTransform(MessageTransformBean.java:528)
        at com.sap.aii.af.modules.trans.MessageTransformBean.processTransform(MessageTransformBean.java:471)
        at com.sap.aii.af.modules.trans.MessageTransformBean.process(MessageTransformBean.java:364)
        ... 36 more
    Caused by: sun.io.MalformedInputException
        at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java:270)
        at sun.nio.cs.StreamDecoder$ConverterSD.convertInto(StreamDecoder.java:287)
        at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:337)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:223)
        at java.io.InputStreamReader.read(InputStreamReader.java:208)
        at java.io.BufferedReader.fill(BufferedReader.java:153)
        at java.io.BufferedReader.readLine(BufferedReader.java:316)
        at java.io.LineNumberReader.readLine(LineNumberReader.java:176)
        at com.sap.aii.messaging.adapter.Conversion.convertPlain2XML(Conversion.java:310)
        at com.sap.aii.messaging.adapter.Conversion.service(Conversion.java:709)
        ... 40 more
    Any ideas?
    Kind regards, Stefan

    Hi Stefan,
    for the first MTB now we are using only one parameter: Transform.ContentType = text/plain;charset="ISO-8859-1"
    The second MTB, which does the XML-Wrapping, is configured like this:
    Transform.Class = com.sap.aii.messaging.adapter.Conversion
    Transform.ContentType = application/xml
    xml.conversionType = SimplePlain2XML
    xml.fieldNames = value
    xml.fieldSeparator = §%zulu§%
    xml.processFieldNames = fromConfiguration
    xml.structureTitle = payload
    Both CCSID configuration parameters from the "Source"-Tab we've set to 850.
    Now, we don't get an error anymore - sun.io.malformedInputException - , but, unfortunately, now special character conversion succeeded (we need an "ß" and we get an ISO-HEX-E1 -> á).  E1 is (different from ISO) an "ß" in 850.
    Any ideas?

  • I have written a binary file with a specific header format in LABVIEW 8.6 and tried to Read the same Data File, Using LABVIEW 7.1.Here i Found some difficulty.Is there any way to Read the Data File(of LABVIEW 8.6), Using LABVIEW 7.1?

    I have written a binary file with a specific header format in LABVIEW 8.6 and tried  to Read the same Data File, Using LABVIEW 7.1.Here i Found some difficulty.Is there any way to Read the Data File(of LABVIEW 8.6), Using LABVIEW 7.1?

    I can think of two possible stumbling blocks:
    What are your 8.6 options for "byte order" and "prepend array or string size"?
    Overall, many file IO functions have changed with LabVIEW 8.0, so there might not be an exact 1:1 code conversion. You might need to make some modifications. For example, in 7.1, you should use "write file", the "binary file VIs" are special purpose (I16 or SGL). What is your data type?
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for