Hi How to get XML file from servlet that XI sent to my J2EE appl?

Hi All!
I have a scenario like XI sends xml file to j2ee application. In my J2EE application my servlet receives this xml. Will the xml file be in my HTTPServletRequest object? if so how to get that file from Request object.
Please help me its urgent, Any code help is highly appreciated.
My xml file will be like this:
<ns0:Http_Message_Type_Demo
xmlns:ns0="http://abcdemo.com">
<Name>ABC</Name>
<RollNo>123</RollNo>
<Address>a-4</Address>
</ns0:Http_Message_Type_Demo>
somebody should help me!please
Thanks

Hi,
You can use HTTPServletRequest object to get the XML payload.
BufferedReader reader = request.getReader(); //gets XML payload
String line = reader.readLine(); // to read the XML payload line by line
(request is the HTTPServletRequest object)
Regards,
Uma

Similar Messages

  • How to get XML file using servlets that XI sent to my J2EE appl?

    Hi All!
    I have a scenario like XI sends xml file to j2ee application. In my J2EE application my servlet receives this xml. Will the xml file be in my HTTPServletRequest object? if so how to get that file from Request object.
    Please help me its urgent, Any code help is highly appreciated.
    My xml file will be like this:
    <ns0:Http_Message_Type_Demo
    xmlns:ns0="http://abcdemo.com">
    <Name>ABC</Name>
    <RollNo>123</RollNo>
    <Address>a-4</Address>
    </ns0:Http_Message_Type_Demo>
    somebody should help me!please
    Thanks

    Hi,
    You can use HTTPServletRequest object to get the XML payload.
    BufferedReader reader = request.getReader(); //gets XML payload
    String line = reader.readLine(); // to read the XML payload line by line
    (request is the HTTPServletRequest object)
    Regards,
    Uma

  • How to refresh XML file  from my client machine

    Hai All
    I have temp.XML and temp.XSL template in our server machine.
    when i give a print from client machine first time it gives the record,and next time it did not get refresh.Always it shows the previous records in the browser.But when i go into the server machine and click on temp.xml,it shows the current record(correct records)
    How to refresh XML file  from my client machine?
    Regards
    Dhina

    You never delete a Time Machine backup by dragging it to the Trash. You are supposed to use the TM application to manage the backups. What you will need to do now is to simply erase the drive using Disk Utility.

  • How to create xml file from Oracle and sending the same xml file to an url

    How to create xml file from Oracle and sending the same xml file to an url

    SQL/XML (XMLElement, XMLForest, XMLAgg, etc) and UTL_HTTP.
    Whether that works for you with the version of Oracle you have, your requirements, and needs is another story. A little detail goes a long way.

  • How to upload XML file from Application server.

    Hi,
    How to upload XML file from Application server.Please tell me as early as possible.
    Regards,
    Sagar.

    Hi,
    parameters : p_file type ibipparms-path obligatory.
    ***DOWNLOAD---->SAP INTO EXCEL
    filename1 = p_file.
    call function 'GUI_DOWNLOAD'
      exporting
      BIN_FILESIZE                    =
        filename                        = filename1
        filetype                        = 'ASC'
      APPEND                          = ' '
      WRITE_FIELD_SEPARATOR           = 'X'
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
      WK1_N_FORMAT                    = ' '
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
    IMPORTING
      FILELENGTH                      =
      tables
        data_tab                        = it_stock
      FIELDNAMES                      =
    exceptions
       file_write_error                = 1
       no_batch                        = 2
       gui_refuse_filetransfer         = 3
       invalid_type                    = 4
       no_authority                    = 5
       unknown_error                   = 6
       header_not_allowed              = 7
       separator_not_allowed           = 8
       filesize_not_allowed            = 9
       header_too_long                 = 10
       dp_error_create                 = 11
       dp_error_send                   = 12
       dp_error_write                  = 13
       unknown_dp_error                = 14
       access_denied                   = 15
       dp_out_of_memory                = 16
       disk_full                       = 17
       dp_timeout                      = 18
       file_not_found                  = 19
       dataprovider_exception          = 20
       control_flush_error             = 21
       others                          = 22
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    Regards,
    Deepthi.

  • How to get XML value using servlet?

    how to get values from a XML file using servlet ? Thank you.
    for example: how can I get the location value (aaa) from this XML file?
    abc.xml:
    <business>
    <location>aaa</location>
    </business>

    Try to use XML Parsers to do the job.
    Use DOM or SAX Parsers that are freely available.
    Some of the popular ones are xerces, DOM, SAX.

  • Best Practices:: How to generate XML file from a ResultSet

    Hi all,
    Could someone please suggest the best practices of how to generate an XML file from a resultset? I am developing a web application in Java with Oracle database and one of my tasks is to generate an XML file when the user, for example, click a "download as XML" button on the JSP. The application is basically like an Order with line items. I am using Struts and my first thought has been to have an action class which will extend struts's DownloadAction and through StAX's Iterator API to create an XML file. I intend to have a POJO which will have properties of all columns of my order and line items tables so that for each order I get all line items and:
    1. Write order details then
    2. Through an iterator write line items of that order to an XML file.
    I will greatly appreciate for comments or suggestions on the best way to do this through any pointers on the Web.
    alex

    Use a OracleWebRowSet in which an XML representation of the result set may be obtained.
    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/oracle10g/webrowset/Readme.html
    http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/jcrowset.htm

  • Getting xml file from web for iPhone App

    Im having an app get an xml file from the web and process it. Ive got the processing part down, ive even got the downloading part done. Problem is so far ive only downloaded a generic xml file hardcoded into the app. I need the user to input a value of the file to get. As a matter of fact, ive been thinking that i may even use the UniqueIdentifier for the iphone to make the file unique enough without the hassle of having to search thru user/pass combinations. So i have the webform to have users enter the values and then their iphones unique ID. But i need to have the user get the unique ID from their phone. Unfortunately ive been able to find this:
    UIDevice *device = [UIDevice currentDevice];
    NSString *uniqueIdentifier = [device uniqueIdentifier];
    [device release];
    NSLog(@"Device GUID:%@", uniqueIdentifier);
    but this number does not show up on the iPhone UserInterface, so my user would have no way of knowing what his/her uniqueIdentifier is
    So my question is 2-fold:
    1. If UniqueIdentifier is the best way to go, how do i have my users visualize their UniqueIdentifier in order to give their xml file that name?
    2. If the user/pass is the best way to go, id have to store user, pass and file name in a database online and have the user create an account which would generate a unique idFilename for him/her and that way fetch the file.

    Hi Marcio -
    I suspect I don't understand your requirements, so if my reply is irrelevant, please tell us a little more about what you're trying to do.
    Marcio Valenzuela wrote:
    1. If UniqueIdentifier is the best way to go, how do i have my users visualize their UniqueIdentifier in order to give their xml file that name?
    I'm not sure what you mean by visualize. If you want the user to see the device id, why not populate a label or text field with it? Otherwise, why not just insert the id into the request yourself? E.g.:
    UIDevice *device = [UIDevice currentDevice];
    NSString *uniqueIdentifier = [device uniqueIdentifier];
    // [device release]; <-- do not release object you don't own
    NSLog(@"Device GUID:%@", uniqueIdentifier);
    textField1.text = uniqueIdentifier; // if we think the user wants to see this
    [self addIdToRequest:uniqueIdentifier]; // implementation is an exercise for the student
    2. If the user/pass is the best way to go, id have to store user, pass and file name in a database online and have the user create an account which would generate a unique idFilename for him/her and that way fetch the file.
    This is up to you. If the download isn't confidential info, it might be ok to rely on the device id. Otherwise you clearly put the owner's info at risk in case someone else operates the device.
    Im having an app get an xml file from the web and process it.
    I'm not sure why you included this info about the downloaded data format, and that's one reason I'm not sure I understand the problem. But I hope the above will help you see what needs to be clarified.
    - Ray

  • How to read .xml file from embedded .swf(flash output) in captivate

    I have been trying to read .xml file from the .swf (Flash output) that is embedded within the captivate file but no luck yet . Please if anyone got any clue on how get this thing done using Action script 3.0 then let me know. I am using Adobe Captivate 5.5 at present and Flash CS 5.5.
    I am well aware about how to read .xml file through action script 3.0 in flash but when insert the same flash in captivate and publish nothing comes in captivate output. I would higly appreciate if anyone could help me out with that.
    Here is is graphical demonstration of my query :
    Message was edited by: captainmkv

    Hi Captainmkv,
    Does the information in this post cover what you're trying to do: http://forums.adobe.com/message/5081928#5081928
    Tristan,

  • How to parse XML files from normal FTP Servers?

    I want to parse xml files from a normal FTP Servers , NOT the sap application severs itself. How can i do that?
    I know how to use the SAPFTP getting and putting files ,but I don't want to download and then parse it.
    Who knows how to parse it directly? I Just need to read the contents into a database.
    Thanks.

    I want to parse xml files from a normal FTP Servers , NOT the sap application severs itself. How can i do that?
    I know how to use the SAPFTP getting and putting files ,but I don't want to download and then parse it.
    Who knows how to parse it directly? I Just need to read the contents into a database.
    Thanks.

  • How to get a file from an internet site

    I have a scenario where I need to get a file from a website.
    Basically on a weekly basis one our customers are going to upload a file that contains all the information for delivery's for the coming week.
    the way this used to be done is the user would go to the website directly and download the uploaded file.
    However now we want to do it as an automatic integration using PI.
    Does anyone have an idea how to do this?  Is it even possible?

    > Thridly my issue with regards to taking a file that is uploaded to a website (it will be a csv file), can be solved by creating a webservice?
    I am sorry, I misunderstood this. I thought you want to download.
    The upload is done with a HTTP POST, so you can use the HTTP receiver adapter.
    Use the prolog and epilog to simulate the form data post.
    Use an HTTP sniffer to get the whole HTTP stream, when you upload the file to the website to see, what you have to put in the HTTP adapter settings.
    Here are some threads about that topic:
    Receiver HTTP Adapter - multipart/form-data file post - SP19
    Re: HTTP Form Post Using HTTP adapter
    Regards
    Stefan

  • How to create xml file from relational tables in 10gR2

    Hi,
    I am very new to XML and was wondering how to create an XML file from querying relational tables. Some child tables may contain multiple rows that need to be returned in certain instances. Other queries will just be single or multiple rows from one or more tables. I would like to use the latest feathers in 10gR2. Thanks for any help you can provide.
    Thanks,
    Lee

    Here is the first row of data created from our person table - it used the column names as the tag names:
    <?xml version="1.0"?>
    <ROWSET>
         <ROW>
              <MP_ID_SEQ>289</MP_ID_SEQ>
              <MP_NAME>LOBERG,JUDITH LEE</MP_NAME>
              <MP_SEX>F</MP_SEX>
              <MP_RACE>I</MP_RACE>
              <MP_DOB>19500709</MP_DOB>
              <MP_HT>504</MP_HT>
              <MP_WT>170</MP_WT>
              <MP_EYE_CLR>BLU</MP_EYE_CLR>
              <MP_HAIR_CLR>BRO</MP_HAIR_CLR>
              <MP_SKN>RUD</MP_SKN>
              <MP_SMT>POCKMARKS</MP_SMT>
              <MP_SOC>517607968</MP_SOC>
              <MP_OLN>517607968</MP_OLN>
              <MP_OLS>MT</MP_OLS>
              <MP_OLY>2007</MP_OLY>
              <MP_CAUT_MED>70</MP_CAUT_MED>
              <MP_VISION_SCRIPT>C0RRECTIVE LENSES</MP_VISION_SCRIPT>
              <MP_DNA_AVAIL>N</MP_DNA_AVAIL>
              <CREATED_BY>MMPS</CREATED_BY>
              <DTM_CREATED>31-AUG-06</DTM_CREATED>
              <MI_INC_ID_SEQ>288</MI_INC_ID_SEQ>
              <MP_ALERT>N</MP_ALERT>
         </ROW>

  • Submit a PDF as a PDF to a servlet, and how to get my PDF from servlet

    Hi all as the title above,
    i have a button typeformat as PDF and sent to a URL( which is my servlet )
    after this step how to get the PDF from my servlet.
    the PDF has sent to my servlet and stop, so is there any way to get the PDF i sent ?
    can someone help me?
    thanks

    You can use the following code:
    byte[] content = getRequestBufferAsBytes(request);
    ...then do whatever you want
    public static byte[] getRequestBufferAsBytes(HttpServletRequest request) throws IOException, ServletException
    // get the RequestBuffer
    ServletInputStream oInput = request.getInputStream();
    long nContentLength = request.getContentLength();
    String contentType = request.getContentType();
    if (nContentLength <= 0)
    return null;
    byte[] cContent = new byte[(int)nContentLength];
    // read the content in 512 bytes chunks
    // a single read does not get all the characters
    int nRead = 0;
    int nToRead = (int)nContentLength;
    int nBlkSize = 512;
    byte[] cTemp = new byte[512];
    do {
    int n = 0;
    int i = 0;
    if (nToRead - nRead < 512)
    nBlkSize = nToRead - nRead;
    n = oInput.read( cTemp,0,nBlkSize);
    for (i = 0; i < n; i++)
    cContent[i+nRead] = cTemp[i];
    nRead += i;
    } while (nRead < nToRead);
    //cContent[nRead] = (byte)'\0';
    Long nBytesRead = new Long( nRead );
    return cContent;
    Jasmin

  • How to get XML files out of activity diagrams of UML

    Using Rational Rose I have developed a model now I want a way to get XML file for each activity diagram of the model built. This XML file will be the input file for Project Cleveland which instantiates the services according to the documentation in this XMl file

    In the Photos mode go to the View menu and uncheck Event Titles. That will leave you with only thumbnails displayed in the Photos view. However, if you close from that mode and reopen the opening time will be slower since iPhoto has to read and render all of the thumbnails. It can get rather long.
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 6 and 7 libraries and Tiger and Leopard. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.≤br>
    Note: There now an Automator backup application for iPhoto 5 that will work with Tiger or Leopard.

  • How to generate XML file from SQL file !

    I am new to XML publisher. I known one way to generate XML file is register one report file in concurrent manager.
    But I want to generate XML file from sql file.
    Could someone show me how to code in sql file, how to register is in concurrent manager.
    Thanks !

    Hi
    Phew ... not sure we have the space here. So I can point you in the right direction:
    1. XML data generation - there are two packages in the db you can use with a plsql procedure, XMLGEN and SQL XML. You can also use java APIs too. Try checking the db documentation and search for the above methods.
    2. Registering the report - the system administrators guide will provide this info. Hooking the program up with XMLP is covered here - http://www.oracle.com/technology/products/applications/publishing/resource/CM%20Whitepaper5.0.pdf
    Regards, Tim

Maybe you are looking for