How to create value objects from xml

I am receiving xml back from my web service ( e4x ). I am
trying to figure out how to create a value object without having to
manually fetch each value in the value objects constructor. I am
using introspecton in my Java web service to do this. Is there such
a thing in Action Script?
Anyone done this before that can share some code???? Any help
would be very much appreciated.

That's twice now I've heard that. lol.
I am using Cairngorm and I suppose out of ignorance perhaps,
I am using VO's. So my web service would return an Object Proxy and
I have some code that could create objects dynamically from the
results. The objects had to be simple of course and now they are
becoming more complex thus the need to change to e4x instead of
objects.
So now I am trying to convert the xml result into the desired
VO to be used throughout the rest of the application. I'm not sure
how to use Cairngorm without the VO's they are tied to everything.
Are you familiar with the architecture? Your thoughts?

Similar Messages

  • Dynamically create Value Objects from XML file

    Hi
    I want to create a value object from Xml file dynamically,like in the xml file i have the name of the variable and the datatype of the variable.is it possible do that,if so how.

    Read about apache's Digester tool. This is part of the Jakartha project. This tool helps in creating java objects from the XML files. I am not sure, if that is what u r looking for.

  • Create value object from xml

    So I've got a value object with 100 fields.
    I have a ASP.net web service that returns the value objects
    as XML (I really don't want to use WebOrb...).
    I don't want to write a lot of code like this:
    vo.Field1 = voXML.Field1;
    vo.Field2 = voXML.Field2;
    vo.Field3 = voXML.Field3;
    Is there an easier/faster way to do this? Can't I do some
    sort of for/each loop. The element names are identical to the field
    names.
    Thanks.

    http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=usingas_053_9.html#220936

  • How to create Inbound Idoc from XML file-Need help urgently

    Hi,
    can any one tell how to create inbound Idoc from XML file.
    we have xml file in application server Ex. /usr/INT/SMS/PAYTEXT.xml'  we want to generate inbound idoc from this file.we are successfully able to generate outbound XML file from outbound Idoc by using the XML port. But not able to generate idoc from XML file by using we19 or we16.
    Please let me know the process to trigger inbound Idoc with out using  XI and any other components.
    Thanks in advance
    Dora Reddy

    Hi .. Did either of you get a result on this?
    My question is the same really .. I am testing with WE19 and it seems SAP cannot accept an XML inbound file as standard.
    I see lots of mention of using a Function Module.
    Am I correct in saying therefore that ABAP development is required to create a program to run the FM and process the idoc?
    Or is there something tht can be done with Standard SAP?
    Thanks
    Lee

  • How to create and object from an arrayList

    Hi I want to create an object from an arrayList.
    here is my code...
    BillingQueryParam billingQueryParam = new BillingQueryParam();
    /*This BillingQueryParam and billingItemManagerActionForm has getter and setter method for following attributes.
    private int billingItemId;
    private String[] paramName;
    private String[] defaultParamValue;
    List billingQueryParamList = new ArrayList();               
    for(int i = 0; i < billingItemManagerActionForm.getParamName().length; i++) {
         billingQueryParam.setParamName(billingItemManagerActionForm.getParamName());
    for(int i = 0; i < billingItemManagerActionForm.getDefaultParamValue().length; i++) {
      billingQueryParam.setDefaultParamValue(billingItemManagerActionForm.getDefaultParamValue());
         billingQueryParam.setBillingItemId(billingItem.getBillingItemId());
         billingQueryParamList.add(billingQueryParam);
    System.out.println("****** ArrayList Size-->"+billingQueryParamList.size());
    for (Iterator iter = billingQueryParamList.iterator();iter.hasNext();) {
         billingQueryParam = (BillingQueryParam)iter.next();
          System.out.println("****** BillingItemId-->"+billingQueryParam.getBillingItemId());
          System.out.println("****** Param Name-->"+billingQueryParam.getParamName()); //printing an array of paramName
          System.out.println("****** Default param value-->"+billingQueryParam.getDefaultParamValue());
    }Here after iterating this list I want to create an object of billingQueryParam which contains a single value of itemId, paramName,paramTypeId and defaultParamName and I want to persist this object in database.
    Please help...!!!
    Thanks

    Now this is too much.. Do i need to tell this thing to u as well. How did u come to this forum?
    Can't u see link to Java programming forum at the top.

  • How to create File object from InputStream

    Hi everybody
    Can I know a way to create a File object from InputStream object
    Here's my code:
    URL url = loader.getResource(xsdFile); //Thats a schema file..not to worry
    InputStream istream = url.openStream();
    Now from that 'istream' I need to build File object.
    Thank you all

    didn't know fileinputstream was made to read url objects ; in the doc, it just says "A FileInputStream obtains input bytes from a file in a file system." ; according to me, website is something outside the filesystem, but i could be wrong
    edit: thought from the beginning it was all about FILEinputstream whereas it just says "inputstream" in the post ; my bad, it's still early in the morning here X)

  • How to create Entity objects using xml as a datasource

    Hi All,
    How to create EO(ADF Business components) using XML as a datasource instead of database tables..Pls do reply..Its an urgent requirement
    Thanks in Advance
    Edited by: 1000899 on Apr 25, 2013 12:01 AM
    Edited by: 1000899 on Apr 25, 2013 12:02 AM

    There is nothing 'urgent' in this forum. We are all volunteers spending our spare time helping out other users. If you have an urgent matter, you have to open an SR with sopport.oracle.com
    If it's urgent, then why don't you provide information needed to answer the question.
    Which jdev version do you use?
    What is the use case?
    To answer your question: A look into the docs http://docs.oracle.com/cd/E35521_01/web.111230/e16182/bcadvvo.htm#sm0341 and http://docs.oracle.com/cd/E35521_01/web.111230/e16182/bcadvvo.htm#sm0338 holds the answer to it.
    Timo

  • How to creat COM object from dll file?

    Hi,
    I tried to read about this topyc, but I didn't found eny example that creat
    COM object. I downloaded jacob.jar
    then I writed:
    ActiveXComponent ax = new ActiveXComponent("C:/MyJava/deploy/SMSCom.dll");
    Object SMSObj = ax.getObject();
    I get error (I put jacob.jar with all athers jars, I don't know way this erre)
    Exception occurred during event dispatching:
    java.lang.UnsatisfiedLinkError: no jacob in java.library.path
         at java.lang.ClassLoader.loadLibrary(Unknown Source)
         at java.lang.Runtime.loadLibrary0(Unknown Source)
         at java.lang.System.loadLibrary(Unknown Source)
         at com.jacob.com.Dispatch.<clinit>(Dispatch.java)file name: SMSCom.dll
    object name: SMSSender
    In VB this is the code:
    Object SMSObj = CreateObject("SMSCom.SMSSender");
    SMSObj.password = pass;
    SMSObj.Username = name;
    SMSObj.Source = phone;Thanks

    In Eclipse:
    1- To include jacob.jar for compile / run:
    Choose the Java perspective, then in the Package Explorer right-click on the project and choose Properties.
    Select Java Build Path from the left pane then the Librairies pane from the right.
    Click on Add External Jars button and select the jacob.jar file then click Open then Ok.
    2- To make jacob.dll and SMSCom.dll "visible" for run:
    Open your Debug (or Run) Java application configuration (the one for your project's main class).
    Select the Environment pane then click on Select button.
    Select Path and click on Ok button.
    Then re-select Path and click on Edit button.
    Add the two appropriate folders for jacob.dll and SMSCom.dll in the Path and click on Ok then Apply.
    Regards

  • Create java objects from xml

    I want to create a tree structure for java object. These java objects are populated after the parsing the xml. But what could be the logic for adding child to parent when there are
    many sub nodes? I wanted to use one recursive function which iterate through all the elements of the xml file. But I have not got the idea how to add one child object to parent object.
    following are my classes. Any help on this highly appreciated.
    public class TreeObject {
              private String name;
              private TreeParent parent;
              public TreeObject(String name) {
                   this.name = name;
              public String getName() {
                   return name;
              public void setParent(TreeParent parent) {
                   this.parent = parent;
              public TreeParent getParent() {
                   return parent;
              public String toString() {
                   return getName();
    import java.util.ArrayList;
    public class TreeParent extends TreeObject {
         private TreeObject treeObject ;
              private ArrayList children;
              public TreeParent(String name) {
                   super(name);
                   children = new ArrayList();
              public void addChild(TreeObject child) {
                   children.add(child);
                   child.setParent(this);
                   treeObject = child ;
              public void removeChild(TreeObject child) {
                   children.remove(child);
                   child.setParent(null);
              public TreeObject [] getChildren() {
                   return (TreeObject [])children.toArray(new TreeObject[children.size()]);
              public boolean hasChildren() {
                   return children.size()>0;
              public TreeObject getChild(){
                   return treeObject;
    private TreeParent getChilderen(Element rootNode){
         List list = rootNode.getChildren();
         String rootNodeName = rootNode.getName();
         TreeParent root = new TreeParent(rootNodeName);
         for (int i=0; i< list.size(); i++)
    Element node = (Element) list.get(i);
    if(node.getChildren().size() > 0){
         // TreeParent treeParent = new TreeParent(node.getText());
         TreeParent treesub = new TreeParent(node.getText());
         treesub.addChild(treesub);
         //TreeParent p = treeParent.getParent();
         // rootParent.addChild(treeParent);
    }else{
         TreeObject object = new TreeObject(node.getText());
         root.addChild(object);
    getChilderen(node);
         return root ;
    public TreeParent buildTree(String filePath) {
    SAXBuilder builder = new SAXBuilder();
    File xmlFile = new File(filePath);
    try{
    Document document = (Document) builder.build(xmlFile);
    Element rootNode = document.getRootElement();
    // List list = rootNode.getChildren("staff");
    TreeParent rootParent = getChilderen(rootNode);
    return rootParent ;
    }catch(IOException io){
    System.out.println(io.getMessage());
    }catch(JDOMException jdomex){
    System.out.println(jdomex.getMessage());
    return null;
    Edited by: 870611 on Jul 6, 2011 6:27 AM

    Hi
    I recommend you use the API JAXB. Is much simpler.
    here a link: http://www.oracle.com/technetwork/articles/javase/index-140168.html
    here a example: http://download.oracle.com/javaee/5/tutorial/doc/bnbay.html#bnbbc

  • How to generate Java objects from XML files with out  scema compilation

    Dear participants,
    My name is Raghavendra , i have a requirement of reading XML files Dynamically and parse them and create java types for manipulation . i will not be provided with sxd files (no schema compilation )coz no one knows how many types of structures are there. i want a generic solution. Please Help.
    Thanks ,
    Raghavendra Ach
    you can mail me to " [email protected]"

    georgemc wrote:
    You could also look at something like Apache Digester, which will parse your XML and populate Java objects with the data. A slightly steeper learning curve than the lower-level APIs such as JDOM, but that's outweighed by the lesser development effortdon't think that would work for the original problem, which seemed to indicate that the xml had an unknown structure.

  • Create file object from xml file in different package

    I have my java class which is in a package...edu.xx.proj
    It contains the following
    File f = new File("formats.xml");
    My xml file is in the package edu.xx.proj.xml
    How do I get the file object for my xml file?
    Ultimately I want that once the jar is shipped .. The path of xml file shld be independent of my OS path... it can only lookup the package path..
    I will really appreciate it if someone can throw some input as to how to resolve this issue..
    Thank you

    I have my java class which is in a
    package...edu.xx.proj
    It contains the following
    File f = new File("formats.xml");
    My xml file is in the package edu.xx.proj.xml
    How do I get the file object for my xml file?
    Ultimately I want that once the jar is shipped .. The
    path of xml file shld be independent of my OS path...
    it can only lookup the package path..
    I will really appreciate it if someone can throw some
    input as to how to resolve this issue..
    Thank you
    InputStream inputStream = getClass().getResourceAsStream("xml/formats.xml");
    /* OR */
    URL url = getClass().getResource("xml/formats.xml");hth

  • How to create Activex object for my Visual C++ object

    Hi,
    I am working on development on Acrobat 9.0 SDK. I am facing problem is that I can compiled Visual C++ source code to an api. I can test functions on this api on Acrobat 9.0 windows, but I could not test it on IE web browser, because I don't know how to create Activex object from my Visual C++ source code or its api.
    I read Acrobat 9 SDK document and found under C:\Acrobat 9 SDK\Version 1\PluginSupport\Tools\Visual Studio App Wizard has two files: Acro9PIWizInstaller.msi and setup.exe. I am not very sure those file are the key to help me to create Activex objects for my api.  Are they the one I need to create Activex object? If not, could you please advise me how to create Activex object for my api or C++ codes.
    Thanks a lot for any of your comments or advices.
    Thai

    Hi lrosenth,
    Thanks a lot for your information.
    My question is, on Javascript how do I call a function from .api. Below is my very simple test.
    I got a function on BasicPlugin.cpp under C:\Acrobat 9 SDK\Version 1\PluginSupport\Samples\BasicPlugin. See below.
    I added BasicPlugin.api on C:\Program Files\Adobe\Acrobat 9.0\Acrobat\plug_ins
         ACCB1 int ACCB2 MyPluginCommand() {
              int num = 5;
              return num;
    On my HTML file, I create an <Object> below:
        <OBJECT id="acrobatapp"
                classid="clsid:85DE1C45-2C66-101B-B02E-04021C009402">
        </OBJECT>
        <OBJECT id="acrobatpdf"
                classid="clsid:CA8A9780-280D-11CF-A24D-444553540000"   >
            <Param name="SRC" value="http://www.adobe.com/devnet/acrobat/pdfs/acrobat_digital_signature_appearances_v9.pdf">
       </OBJECT>
    On my Javascript. I call function MyPluginCommand() as below, but it is not working. How do I call function MyPluginCommand() on Javascript?
         var acrobatapp= document.getElementById("acrobatapp");
         var num= acrobatapp.MyPluginCommand();
         alert(num);
    Thanks for your support,
    Thai

  • How to get value object (entity abject) from ViewObject?

    How to get data from ViewObject in the form of value object? I know BC4J creates entity object for database table/view (looks like value object) but I did not find api to get entity object from ViewObject.
    Thanks.

    BC4J provides an implementation of the value object design pattern for you, so you don't have to waste time writing your own.
    I wrote a whitepaper illustrating how to take advantage of this at:
    Implement Collections of Value Objects for MVC Apps with BC4J
    This allows clients (like a servlet, a JSP, a Swing client, etc.) to get value objects from the collection of value objects that BC4J supports.
    However, if you are writing code inside your view object implementation class and want to access the entity object, just call the accessor that we generate into your view row implementation class for you. For example, for a VO named EmployeeView that uses an entity object named Employee, there will be a private accessor method getEmployee() that will give you the entity.

  • How do I create an object from a filename?

    I'm traversing directories and storing a list of files in a File array. Then I traverse the array looking at the extension of the file. If it is .java then I would like to instantiate it as a class so that I may pass the new object to another function which will examine its methods. I've tried Class.forName(file.getCanonicalPath()) and it throws a ClassNotFound exception. How can I create an object from a valid filename, please?

    Rick_Avlonitis wrote:
    If it is .java then I would like to </snip>.java files contain source code, they can't be "instantiated". Class.forName() takes a classname as parameter, i.e. "mypackage.MyClass". A class name is not a file name, and it doesn't have an extension. As stated in the other reply, you'll need to have the class on your class path.

  • How to automatically create fillable PDFs from XML

    We are looking for a way to create fillable PDFs that users can enter data into and save (so the PDF needs Reader Rights applied) and we want to be able to automatically create these PDFs from XML files. We are able to do what we want in a manual fashion using Acrobat Pro v8 but we need a way to automate this due to the volume of XML files that we will need to convert.
    Is there any way that this can be scripted from a command line interface with Acrobat.. like:
    Acrobat.exe –input FileName.xml –output FileName.pdf –applyReaderRights true
    If there is no command line options for this is there any way that this could be coded using .NET or any other programming language?

    You cannot automate applying usage rights with Acrobat. For that you'd need to use Adobe's LiveCycle Reader Extensions.
    How exactly are you currently converting XML into fillable forms? Are you using an XDP to somehow convert to an XFA-based PDF?

Maybe you are looking for