Some JAXB code to read?

I am wondering if anyone would be so kind as to provide me with some example
code showing a class that outputs the following document:
<?xml version='1.0' encoding='utf-8'?>
<parameters>
     <fileBoxInfo>
          <filename>r:\files\practice\file.txt</filename>
          <filename>r:\files\practice\file2.txt</filename>
                <filename>r:\files\practice\file3.txt</filename>
     </fileBoxInfo>
     <reports>
          <reportName>Report</reportName>
     </reports>
</parameters>I mostly want to see the actual code to parse output the XML document, i am
a bit confused as to how this works. I did a search and many of the places I
found suggested outputing the XML document using write statements, and
building the XML lines using the String class i.e.=
"<" + tagName + ">" + value + "</" + tagName ">" ;
but I would rather learn the nitty-gritty stuff, as ugly as it very well may be.
Can anyone help me? this is NOT for homework, this is a project i am doing
at work where i have the opportunity to learn JAXP and JAXB.
I sincerely appreciate any help you give. Thanks in advance

1. U need to have a XML schema defined first for ur XML
2. Download Java WebServices Developer Pack
3. use JAXB compiler to generate the binding code
4. Then u can use JAXBContext, Marshaller etc classes to output the below XML
YES, it is not as straight forward as we expect.

Similar Messages

  • How to write java code to read the pixel color in some place of screen?

    Hello all:
    How to write java code to read the pixel color in some place of screen?
    The java application iteself doesn't have any GUI.
    thank you
    -Danel

    See java.awt.Robot

  • Code to read local notepad.txt from applet

    Hi.
    Further to my (unanswered) queries about reading a notepad.txt file from the local directory i.e. the same directory from which the html and applet were launched, the following code is supposed to be able to read the local file. It failed to do so both in Netscape 7.1 and in IE5
    I've also received conflicting advices : some says we can read local files without using a signed applet or chaning the ACL, whereas others I'll need to use signed applets and / or acl to allow the applet to read a local file.
    My research has shown that java applets are supposed to be able to read local files. Has something changed:
    public class FileAccess extends Applet
       implements ActionListener {
       Button loadButton, saveButton;
       TextField filename;
       TextArea  content;
       String browserName;
       boolean securitySupported = false;
       public void init() {
         setLayout(new FlowLayout());
         Label label =
           new Label("Simple file editor");
         add(label);
         loadButton = new Button("Load");
         saveButton = new Button("Save");
         add(loadButton);
         add(saveButton);
         loadButton.addActionListener(this);
         saveButton.addActionListener(this);
         filename = new TextField(20);
         add(filename);
         content = new TextArea(5,20);
         add(content);
         browserName = System.getProperty("java.vendor");
         if (browserName.indexOf("Netscape") > -1)
            securitySupported = true;
         setSize(200, 200);
       public void actionPerformed(ActionEvent evt)  {
         if (securitySupported) {
            if (evt.getSource() == saveButton) {      
               PrivilegeManager.enablePrivilege("UniversalFileAccess");
               try {
                  FileWriter aWriter = new FileWriter(filename.getText(), false);
                  aWriter.write(content.getText());
                  aWriter.flush();
                  aWriter.close();           
               catch(Exception e) {
                 e.printStackTrace();               
            else if (evt.getSource() == loadButton) {
               PrivilegeManager.enablePrivilege("UniversalFileAccess");
               try {
                  BufferedReader aReader  =
                     new BufferedReader
                        (new FileReader(filename.getText()));
                  content.setText(aReader.readLine());
                  aReader.close();           
               catch(Exception e) {
                 e.printStackTrace();               
          else {
            getAppletContext().showStatus("security not installed");
    }

    Hi acinhk,
    I read your note with great interest. I am trying to solve almost exactly the same problem as you are -
    Reading a .txt file in IE5 from the same directory where the html and the applet were lauched.
    Your code looks fine to me.
    My code is very similar, and again generates a security exception - as I am having the same problem you had getting around Java security.
    If you have been able to solve the problem, can you please let me know what you did.
    Any modifications to your sample code that actually made it work would be greatly appreciated.
    Also, is signing the applet to read a local file under IE5 really necessary ?
    Can the file be read from the local IE file system without signing the applet ?
    Please let me know your thoughts.
    Thanks !
    drbob

  • Auto closing of dispute cases--only for some company codes

    Hi
    We have activated dispute management for several company codes in our system. The auto closing of dispute cases also has been activated in status management. Cases are automatically closed by the system (through a batch job) when the last disputed object is cleared.
    Now there is a requirement to deactivate auto closing only for some company codes. They want to close cases manually in these company codes.
    Is this possible and if so how?
    Regards
    Raj.

    You cannot deselect at a company code level.
    Can we go through you proposed process.
    So you have a dispute for $100.
    The customer pays it and the dispute closes.
    Then the customer calls up and says they have an issue with the invoice they paid previously.
    I have seen this happen before but there was a little twist
    1 - The customer raised a debit note against the client for the issue that they had. The original invoice is cleared but a debit note is created and then disputed and processed. So you can close the original dispute and create a new dispute against the debit note
    2 - The customer paid the wrong invoice. The dispute was closed. However to rectify the miss allocation the clearing document will be reversed meaning the dispute is "re-opened" and can be processed.
    I am unaware of any other requirement for a customer to "re-dispute" a paid item in SAP.

  • Please send me some sample codes of ALVS  using function modules only

    Hi,
    i am new to alvs
    Please send me some sample codes of alvs using function modules only.
    My mail id is [email protected]
    Thanks & regards,
    hari priya

    hI
    http://www.sapdev.co.uk/reporting/reportinghome.htm SPECIAL FOR ALL ALV PROGRAMS WITH EXAMPLE CODES
    Check the below links :
    http://www.sap-img.com/abap/sample-programs-on-alv-grid.htm
    http://www.sap-img.com/abap-function.htm
    http://www.sap-basis-abap.com/sapab034.htm
    http://www.erpgenie.com/abap/example_code.htm
    These all are very simple ALV programs ,good luck
    <b>Reward if usefull</b>

  • Kindly write some sample code for this scenario

    Kindly write some sample code for the below Logic.
    For a set of Deliveries entered on the selection screen get the relevant data from LIKP & LIPS.
    for all the deliveries selected get the sales order data from VBAK & VBAP based on the VGBEL & VGPOS in LIPS.
    The Output internal table should contain only deliveries which are created with reference to a sales order.
    Thanx in Advance.
    Akshitha.

    Hi,
    Select avbeln bposnr bmatnr blfimg bvgbel bvgpos into table ITAB
       from likp as a join lips as b on Avbeln =  bvbeln
       where a~vbeln in s_vbeln..
    if not itab[] is initial.
       select avbeln bposnr b~matnr ... into table itab1 from vbak as a join vbap as b
       on avbeln = bvbeln
       for all entries in itab where avbeln = itab-vgbel and bposnr = itab-vgpos.
    endif.
    loop at itab.
    read table itab1 with key vbeln = itab-vgbel posnr = itab-vgpos.
      if sy-subrc <> 0.
          delete itab index sy-tabix.
       endif.
    endloop.
    Now ITAB will have only deliveries created against Sales orders.
    reward points if useful
    regards,
    Anji

  • WebDynpro Abap code to read IView Name

    Hi Friends,
    Could you please give me Webdynpro abap code to read the name of the Iview.
    Regards,
    Lakshmi Prasad.

    Hello Lakshmi,
    I dont think this is possible. If you want to differentiate from which iView your web dynpro application is launched, then you can pass some constant as Application Parameter in the iView. and in the web dynpro application you can read this parameter and perform your required logic.
    For example suppose say your web dynpro application is hosted in iView1 and iView2. In both the iview properties, pass a parameter (say IVIEWNAMe) with values 'iView1' and iView2 respectively.
    then in the Webdynpro -> Window Controllers' -> default event handler method, you read the parameter IVIEWNAME and based on the value you can peform your logic.
    BR, Saravanan

  • ABAP Code to Read Characteristic from Another DSO

    Gurus and Experts,
    Plain and simple, I need a piece of ABAP code that reads a characteristic value from a different DSO.
    Here is the story. I have a data flow from DSO Delivery1 to DSO Delivery2. I need to write a code in the start routine of the transformation to read Sales_Doc_Type from DSO Sales1. The condition is, if Delivery1-Ref_Doc_Nr = Sales1-Sales_Nr then Delivery1-Sales_Doc_Type = Sales1_Sales_Doc_Type.
    I am a beginner in SAP BI and know nothing about ABAP. But I do have experience in SQL and Java.
    Any help or links or direction will be appriciated. Thanks in advance.
    Herru

    Hello,
    I think there is a correction in your Ques. That there are two DSO Delivery1 and Sales1...... I Hope this is Ok.
    Tables Required:----  Go To SE11 and *<DSO_NAME>00 You will get active table for your DSO. EG. /bic/Delivary100 and /bic/sales100
    Logic In start Riutine:----
    1. Define structure in Global Def. for Sales1 DSO.
    2. Also Define Internal table in Global Def. (I hope you know the syntax)
    3. now you will find that start writing code from below.
            Inclue:------ Select Statement from Slaes1 DSO into itab for all entries in source package.
    4. Loop source_package assigning <result_fields>.
    read itab into wa where Sales1-Sales_Nr = <result_fields>-Ref_Doc_Nr.
    <result_fields>-Sales_Doc_Type = wa-Sales1_Sales_Doc_Type.
    endloop.
    This logic will work..........
    If still you are find it difficult then take some abaper help.
    Regards,
    Ankit.

  • I want to skip some html code part when refersh the page, how can we know

    Hi,
    i want to skip some html code part when refersh the page, how can we know when we pressed refresh button or F5 key
    thanks in advance....

    There's not really any simple way to do this. Maybe tracking the page the user should be one from every page in the site and if the page being accessed is the same as the last one accessed, assume it was a refresh.

  • When using 6.0 beta and 7.0 beta on my MacBookPro, I am (too) frequently asked for my master password. This doesn't occur in other programs. Do I have some evil code in my Firefox program?

    When using 6.0 beta and 7.0 beta on my MacBookPro, I am (too) frequently asked for my master password. This doesn't occur in other programs. Do I have some evil code in my Firefox program?
    Why I'm asked for my Master Password seems troublesome.

    Hello Matt, fellow archaeologist :)
    Security updates are essential on any and all software, specially your browser. Mozilla is working to streamline the updating process as much as possible, but you shouldn't neglect your own security for a few seconds of "wasted" time.
    I hope you do the best for yourself.

  • Air QR code generator/reader

    Anyone have any current recommendations for Air QR code generator and reader (ANE, lib)?
    I need a solution that will:
    1) Generate a text/string QR code in Air desktop
    2) Generate a text/string QR code in Air cross-platform mobile app (android or iOS).  Same code base as #1.
    3) Scan the QR code on cross-platform mobile device (android, iOS) from within my Air app.
    I see a lot of search results for various ways, but so far nothing cross-platform.
    Thanks!
    Don

    Hi Sbhave.
    Thanks for your response.
    I still need to read the post but it certainly looks interesting.
    I think it explains how I can make a QR Code having contact details.
    I got your AS3 Qr Code reader to work and it reads a QR Code BEAUTIFULLY, even a VCard. Now your code simply reads the QR Code and outputs the read to a window. Your code doesnt tell the mobile device what to do with the output. Now it is easy enough to add some code which, if the data is a web address, will go to that webaddress. However if I have used your QR Reader (in AS3) to read a vcard how do I code the Reader so that it knows that it must add the contact info to my mobile devices contacts list  and can actually do this ? I have some commercial QR Code readers which use the Zing Library and recognise that its a Vcard and give the choice to save to the contacts list.
    Thanks
    Paul

  • How to replace huge decode statements with lookups to some simple code/key

    I have a legacy PL/SQL application, composed of many very huge decode statements. And the most terribe one is that the guys who develops the application left the company now, leaves no documentation.
    We are trying to read and understand those PL/SQL programs, and I'm asked to replace those huge decode statements with lookups to some simple code/key tables? But I have no idea about how to design such code/key tables. Is there any one who has similar experience may help me? Besides code/key tables, any idea will be welcome.
    Thank you very much!

    Not sure what your data looks like but sometimes decode can be replaced with more appropriate functions, ie;
    SQL> with t as (
       select 'DAY' a, 30 b, null c, null d from dual union all
       select null a, null b, 'MONTH' c, 12 from dual)
    select coalesce(b,d)
    from t
    COALESCE(B,D)
               30
               12
    2 rows selected.
    SQL> with t as (
       select 'DAY' a, 30 b, null c, 0 d from dual union all
       select null a, 0 b, 'MONTH' c, 12 from dual)
    select greatest(b,d)
    from t
    GREATEST(B,D)
               30
               12
    2 rows selected.

  • I click on Farmville Game in FB to play, get blank window pop up w/ "Mozilla Firefox" at top. As blinks off some long code states proxy something. Only on FB Farmville game. nothing different. Blinks on & off continuously, difficult to play game.

    When I click on Farmville Game in Facebook to play, keep getting blank window popping up w/ "Mozilla Firefox" at the top. Then blinks off some long code that states proxy something. Only does it on FB Farmville game. Did nothing different. Blinks on & off continuously, difficult to play game.

    When I click on Farmville Game in Facebook to play, keep getting blank window popping up w/ "Mozilla Firefox" at the top. Then blinks off some long code that states proxy something. Only does it on FB Farmville game. Did nothing different. Blinks on & off continuously, difficult to play game.

  • [svn:fx-3.x] 7966: Clean up some packaging code

    Revision: 7966
    Author:   [email protected]
    Date:     2009-06-18 12:30:22 -0700 (Thu, 18 Jun 2009)
    Log Message:
    Clean up some packaging code
    bug: no
    qa: no
    Modified Paths:
        flex/sdk/branches/3.x/build.xml

    Back up all data to at least two different storage devices, if you haven't already done so. One backup is not enough to be safe. The backups can be made with Time Machine or with Disk Utility. Preferably both.
    Erase and install OS X. This operation will destroy all data on the startup volume, so you had be better be sure of the backups. If you upgraded from an older version of OS X, you'll need the Apple ID and password that you used, so make a note of those before you begin.
    When you restart, you'll be prompted to go through the initial setup process in Setup Assistant. That’s when you transfer the data from a backup.
    Select only users and Computer & Network Settings in the Setup Assistant dialog—not Applications or Other files and folders. Don't transfer the Guest account, if it was enabled.
    After that, check the App Store for software updates.
    If the problem is resolved after the clean installation, reinstall third-party software selectively. I can only suggest general guidelines. Self-contained applications that install into the Applications folder by drag-and-drop or download from the App Store are usually safe. Anything that comes packaged as an installer or that prompts for an administrator password is suspect, and you must test thoroughly after reinstalling each such item to make sure you haven't restored the problem.
    I strongly recommend that you never reinstall commercial "security" products or "utilities," nor any software that changes the user interface or the behavior of built-in applications such as Safari. If you do that, the problem is likely to recur.
    Any system modifications that you do choose to install must be kept up to date. None is required for normal operation.
    Before installing any software, ask yourself the question: "Am I sure I know how to uninstall this without having to wipe the volume again?" If the answer is "no," stop.
    Never install any third-party software unless you know how to uninstall it.

  • Wsdlc & jaxb code inject plugin

    Is there a way to use the JAXB code injector plugin with wsdlc ?
    I need to pass -Xinject-code in addition to the <ci:code> in the binding files.
    wsdlc essentially wraps wsimport. I can use 'xjcarg' args to pass parameters to XJC compiler.
    How do i do the same with wsdlc ?

    It turns out that my problem is having a wrong prefix name in the package-info.java for my data package. Once I used the correct prefix name and rebuilt the JAR then my troubles went away.
    The line in question in the package-info.java where the error was located:
    @javax.xml.bind.annotation.XmlNs(prefix =

Maybe you are looking for

  • IDOC failure in R/3 Inbound processing

    Hi   I was able to successfully generate XML files from Syndicator, but when it comes for processing in R/3 side it get fails all the time with the IDOC err msg : "IDoc included in IDoc packet containing an error: transfer it separate ".   Kindly adi

  • Settings wont open?

    ok so i have a white ipod touch 4g ios 5 and i just put a passcode on my ipod after a couple of minutes i tap settings and its just a blank page then i waited and it just went back on the home screen

  • Probleme execution class java in the process flow

    when i try to execute a simple process flow contain process java i have this message error can somme one help please RPE-02229 : Les informations de débogage suivantes ont été collectées : RPE-02230 : Informations de débogage : os.name = Windows XP R

  • Using Java/JVM as a Scripting Component in C++

    I've been doing some research into the JNI and had a couple questions. Specifically, what I'm looking for is the use of Java / the JVM as a scripting language for a C++ application. I'd like to combine the speed of C++ as the application's core with

  • REALLY need some help with my problem (Netgear and...

    Hi everyone, Well... where to start really. This morning around 5am, I lost connection to the net, yet my Netgear (DG834 wired) showed an uptime of 117 hours, so it showed no reboot. It seems my IP profile was raised (As it was low before for my sync