Serialize in XML

Hello,
I have a question.
Why this does't works ?
I have a class
import java.io.FileOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.beans.XMLEncoder;
public class Voiture {
    private String marque = new String();
    private String couleur = new String();
    private int nbPortes = 4;
    private long kmParcourus = 0;
    private double uneValeurDouble = 0;
    public Voiture(String marque, String couleur, int nbPortes, long kmParcourus, double uneValeurDouble) {
        this.marque = marque;
        this.couleur = couleur;
        this.nbPortes = nbPortes;
        this.kmParcourus = kmParcourus;
        this.uneValeurDouble = uneValeurDouble;
    public String getMarque() {
        return marque;
    public void setMarque(String marque) {
        this.marque = marque;
    public String getCouleur() {
        return couleur;
    public void setCouleur(String couleur) {
        this.couleur = couleur;
    public int getNbPortes() {
        return nbPortes;
    public void setNbPortes(int nbPortes) {
        this.nbPortes = nbPortes;
    public long getKmParcourus() {
        return kmParcourus;
    public void setKmParcourus(long kmParcourus) {
        this.kmParcourus = kmParcourus;
    public double getUneValeurDouble() {
        return uneValeurDouble;
    public void setUneValeurDouble(double uneValeurDouble) {
        this.uneValeurDouble = uneValeurDouble;
    public static void main(String argv[]) {
        Voiture uneVoiture = new Voiture("Une marque", "Bleue",5,1000,5.2);
        try {
            FileOutputStream filOut = new FileOutputStream( "uneVoiture.xml" );
            XMLEncoder encoder = new XMLEncoder( filOut );
            encoder.writeObject(uneVoiture);
            encoder.close();
            filOut.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();  //To change body of catch statement use Options | File Templates.
        } catch (IOException e) {
            e.printStackTrace();  //To change body of catch statement use Options | File Templates.
}And when I run it, the xml file is
<?xml version="1.0" encoding="UTF-8"?>
<java version="1.4.2_02" class="java.beans.XMLDecoder">
</java> Why the serailization doesn't works ???
Please help me
Thanks

http://java.sun.com/products/jfc/tsc/articles/persistence4/
This articles brings further information on xml serialization.
Enjoy,

Similar Messages

  • Document in xml - Not serializable?

    Hi, I was working with the Document in xml.
    I tried to serialize it, but it seems that the implemantation of it is not serializable.
    The problem is that the object is created with a factory method, so also inheriting it is no use, since the creation is not in our hands.
    The only solution i can see is to inherit also the Factory and to ovverde the creation method.
    Any suggestion?
    Thanks,
    Doron

    why do you want to serialize the document object?
    you might as well serialize the xml file it represents and when or where needed, just parse it and get its document object, which would essentially be the same as the object you are trying to serialize.

  • XML Serialization

    Ok so im at a loss, can anyone point me in the right direction:
    Im trying to serialize to XML a simple object node (see below). Im using archiver
    (http://java.sun.com/products/jfc/tsc/articles/persistence/index.html) to do this.
    Heres the code im using to serialize:
        public static void main(String[] args) {
            try {
                Node n = new Node("Frying pan","N1",Node.MAIN);
                ObjectOutput os = new XMLOutputStream(System.out);
                os.writeObject(n);
                os.close();
            catch (Exception e) {
                e.printStackTrace();
        }(so Node.Main is simply an integer)
    the output:
    <JAVA-OBJECT-ARCHIVE VERSION="0.1">
    <CLASS ID="Node" NAME="SmartTicket.Server.Network.Node"/>
    <CLASS ID="Integer" NAME="java.lang.Integer"/>
    <OBJECT ID="Node0" CLASS="Node">
    <OBJECT PROPERTY="type" CLASS="Integer" VALUE="2"/>
    </OBJECT>
    </JAVA-OBJECT-ARCHIVE>
    which is close but definately no cigar: im missing group and id ("Fring pan" and "N1" respecively).
    Now it took me a while to get this far, I was just getting errors until I read that objects had to have a no args constructor, so I put one in.
    But i dont really understand this XML serialization and cant seem to find out much. I keep getting thrown around to differant things:
    SAX
    XMLEncoder
    JAXP
    X-Stream
    Archiver
    something to do with IBM that I wont download.......
    I mean is there a way to alter how the object is serialized?
    (like overriding writeObject(java.io.ObjectOutputStream out) when using .io.Serialization).
    what makes an object XMLSearializable?
    Im at a loss.
    Any links, pointing in the right direction greatly appretiated.
    Chris
    The constructors and variable of Node object (methods not shown);
        public static int HIDDEN = 1;
        public static int MAIN = 2;
        private String group;
        private final String idSt;
        private int type;
        private Vector leavingEdges;
        private Vector incomingEdges;
        public Node(String group, String idSt, int type) {
            this.group = group;
            this.idSt = idSt;
            this.type = type;
            this.leavingEdges = new Vector();
            this.incomingEdges = new Vector();
        public Node(String group,String name) {this(group,name,HIDDEN);}
        public Node(String st, int type) {this(st,st, type);}
        public Node(String name) {this(name,name,HIDDEN);}
        public Node() {this("test","test",HIDDEN);}

    Further investigation by me shows that I was way off the mark and should have been using XMLEncoder/XMLDecoder. This right?
    Well I got things half working, can't quite seem to get the hang of these PersistenceDelegate methods.
    How exactly should JavaBeans be constructed? I can't seem to find aclear definition anywhere.
    In my objects I dont have and I dont want to add get/set methods for each field. Yet even if I give the defaultPersistenceDelegate the field names of the main constructor I get erros when reading the file:
    unknown method Edge.new(Node0)
    where Edge is indeed my object but at no point have I ever said that its constructor takes 1 argument.
    I've looked through the code for defaultPersistenceDelegate and I can't see a reason why it would reduce the number of constructor parameters than those I gave it.
    Where am I going wrong?
    Also the whole Beans concpet always seesm geared towards GUI applications, am I looking at the wrong thing if i just want to store normal data as XML?
    Any pointers?
    Thanks
    Chris

  • Serializing XML Documents(not Java Serialization)

    Hi,
    Iam looking for a class that can serialize the XML documents.
    Heres the problem in detail:
    - I need to create an XML String from scratch taking data from a database.
    - I created the XML Document adding the childs and attributes.
    - I need an XML string from the document. Iam not exactly sure how to do this. But Apache Xerces package provides an XMLSerializer class where we can convert the document into a string.
    Is there any functionality provided. If so where can i find it.
    Thanks,
    -Rao

    Not sure if this is a bug or not (filing one just in case it is) but the following program demonstrates that with 2.0.2.9 the internal subset is serialized correctly if the document was parsed with validationMode set to true. If set to false only the entities show up in the internal subset.
    package xmlbugs;
    import java.io.*;
    import org.w3c.dom.*;
    import oracle.xml.parser.v2.*;
    public class TestSerializeLocalSubset {
    private static final String xml =
    "<?xml version='1.0' encoding='UTF-8'?>"+
    "<!DOCTYPE bar ["+
    "<!ENTITY bar 'baz'>"+
    "<!ELEMENT foo EMPTY >"+
    "<!ELEMENT bar (foo) >"+
    "]>"+
    "<bar><foo/></bar>";
    public static void main(String[] a_ ) throws Exception {
    System.out.println("Test with parser in validation mode = false");
    DOMParser d = new DOMParser();
    d.setPreserveWhitespace(false);
    d.setValidationMode(false);
    d.parse( new StringReader(xml));
    Document x = d.getDocument();
    XMLDocument xx = (XMLDocument) x;
    xx.print(System.out);
    System.out.println("Test with parser in validation mode = true");
    DOMParser d2 = new DOMParser();
    d2.setPreserveWhitespace(false);
    d2.setValidationMode(true);
    d2.parse( new StringReader(xml));
    x = d2.getDocument();
    xx = (XMLDocument) x;
    xx.print(System.out);
    }

  • Serialize stateful session bean to xml

    Hi,
    Here is the scenario:
    1. Stateful session bean is created.
    2. XML message is sent to the queue. The xml message needs to have a reference to the session bean created in the first step.
    3. MDB.onMessage reads the xml and invokes a method on the stateful bean
    What are the different approaches to implement the second step? That is to create a reference to an instance of the session bean and at runtime invoke the same instance.
    Thank you

    Hi,
    I don't know if it works with a serialization to xml, but for (for example) a web application you would probably put the handle to the statefull session bean in the session. If I am not wrong, the implementation of handle object should be serializable (http://java.sun.com/products/ejb/javadoc-1.0/javax.ejb-javadoc/javax.ejb.Handle.html)
    Please post a reply if it worked, because the problem is interesting
    Georges
    Handle h = (Handle) session.getAttribute("myStateful");
    MyStateful statefulBean = null;
    if ( h == null) {
    statefulBean = createStatefulEJB();
    if (statefulBean != null) {
    h = statefulBean.getHandle();
    session.setAttribute("myStateful", h);
    } else {
    statefulBean = (MyStateful) PortableRemoteObject.narrow (h.getEJBObject() , MyStateful.class);

  • XML parsing error in Webservices

    Hi All,
    We have a web services to get service order details. It shows
    the following error sometimes on the browser.
    "XMLParser : #0 not allowed in Character data sections (:main:, row:1, col:0)"
    This particular error occurs only in quality system not in development. We found that this particular error is due to some special characters present in the service order notes(intergal/general). But same content doesn't reproduce the error in development system web services.
    I tried to find the place where exactly this error is populated to webservices. But i couldn't able to acheive it.
    But in transformation serializations the xml is getting filled. As of ma understanding there is no problem in serializations. Can anyone please tell the exact xml verification method/routine where this error might be thrown?.
    And the special character is passed as ' #'(space#) in export parameter(table) of web services function module. But we get the error as #0 not allowed .
    Your help is very much appreciated.
    Thanks,
    Karthik

    Hi All,
    I have solved this issue using the SAP note 1559677.
    Hope it helps someone.
    Thanks,
    Karthik

  • Generating XML Using JAVA

    How to generate XML usng java without using following.
    import org.apache.xerces.dom.DocumentImpl;
    import org.apache.xml.serialize.OutputFormat;
    import org.apache.xml.serialize.XMLSerializer;
    XML to be generated is as follows.
    <?xml version="1.0" encoding="UTF-8"?>
    <Modi xmlns:xsi="Modi/Modi1">
    <docConfig>
    <className>PO</className>
    <classDesc>Purchase</classDesc>
    <create>Y</create>
    </docConfig>
    <indexConfig>
    <index sequence="1">
    <shortName>PODATE</shortName>
    <displayName>PO Date</displayName>
    <type>date</type>
    <length>10</length>
    </index>
    </indexConfig>
    </upload>

    Two answers.
    If you want to not use any of the XML-oriented classes, you can use a PrintWriter. Just code:
    PrintWriter pw = new PrinteWriter(whatever);
    pw.println( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" );
    etc.If you want to use XML-oriented classes, but just not these 3 (can't imagine why), then use
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    instead of XMLSerializer and OutputFormat, and
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    instead of the DocumentImpl
    Dave Patterson

  • Re-Using XML file from decode barcode + extract xml process

    I was hoping someone could put me in the right direction here. I am decodeing the information stored in a 2D Bar code and sending this information to an XML file, then I am trying to combine that xml file with a blank PDF template but the process is failing beacuse there are some additional tag fields the XML data from the  Decode->Extract XML process.
    The XML file from the decode process gives the structure below..notice therer some extra tags (lines 2- 4)
    <?xml version="1.0" encoding="UTF-8"?>
    <xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
    <xfa:datasets>
    <xfa:data>
    <form1>
    The XML structure that is expected by the PDF template is as follows
    <?xml version="1.0" encoding="UTF-8"?>
    <form1>
    So the xml output of the Decode barcode + Extract XML process has three extra lines of tag. Is there a way I could use a process within liveCycle to clean out those three lines in real-time before sending the xml to be recombined with the PDF template.
    Thanks

    Hi,
    What you may do is to use the SetValue and its xpath builder functions to "serialize" the xml into string, "substring" to remove the extra tags, and "concat" to add the extra tags and then "deserialize" it again to an xml to be merged with your form.
    Greetings,
    Yasser

  • Oracle Service Bus 11g omit-xml-declaration="yes" not working in XSL-T

    I have the requirement of removing the XML header from xsl output.
    eg: <?xml version="1.0" encoding="UTF-8" ?> this part has to removed
    I tried using the following in XSLT:
    <xsl:output indent="yes" omit-xml-declaration="yes" />.
    It seems to work in all online xml compilers. It does not work in work in OSB.
    I posted the message in a JMS Queue and it contains the xml header.
    Is this a work around for this issue?

    I'm pretty sure XSLT has nothing to do with that PI.
    After all, XSLT in OSB doesn't format text, it generates an XmlObject. The formatting (including adding the <?xml?> PI) are done by other parts of the engine. Probably the XmlBeans serializator.
    The only option I see is to serialize the XML, then cut off everything until first ?>.
    Why would you need that, I wonder? May be there is a better way.
    Vlad @ genericparallel.com

  • Domain design causing full object graph serialization

    Hello,
    I work on a project, based on 3-layer-architecture. We have rich client developed on swing, application server and we persist our domain objects in the database.
    We map the domain objects using hibernate, send the same objects (means, we use POJOs and don't use DTO) via spring from application server to the server and visa versa in case the objects are to be saved, deleted etc.
    We use an object identity store on the client side, in which all already loaded objects are stored.
    My challenge is as follows:
    - Since an object is stored in the object store, the same certain object is used in every GUI module. Imagine, we have customer, account and a list of transactions per account. In practice, let's say:
    1 customer
    2 accounts
    1000 transactions per account which ever exist
    - In one of the modules, the used loaded all list of transactions. So, at that moment, 1 customer object, 2 accounts and 2000 transaction objects are bound to each other via java references (object graph).
    - On another module, the user wants to edit a very small attribute of customer object, say he corrects his birthday date and saves it.
    - Saving operation sends the customer object to the server. But the problem is, a very big object graph hangs on this one little customer object and are serialized to the server, although the
    service.save(customer);is called, and this costs extremely much time for our application.
    boldSOLUTION:*bold* We solved the problem with a hack, as we used the serialization over XStream framework from Thoughtworks in xml-format. We could set a cut in the serialization and have serialized only the customer object for that use case.
    So the problem for the save-use case was solved. This has a disadventage: the loading time (server-client (de-)serialization) using xml is longer than the java standard, especially remarkable if you load a big number of objects.
    I've read many articles about the enterprise architectures which are related to domain objects, dto, serialization. It is not uncommon to avoid DTOs and use POJOs on the server and client as well, if the domain objects don't contain business logic. So, I just wonder, how the problem above should be solved smartly, if the non-DTO, say POJO alternative is chosen.
    I appreciate your opinions.
    I hope my question is not too long. Thanks in advance,
    A sample code:
    (The concrete case in our application requires the navigability from customer to account)
    public class Customer implements Serializable {
         private Set<Account> acounts = new HashSet<Account>();
         // Getters, setters
    public class Account implements Serializable {
         private Set<AccTransaction> acounts = new HashSet<AccTransaction>();
         // Getters, setters
    public class AccTransaction implements Serializable {
         private String operation;
         private Timestamp timestamp;
         // Getters, setters
    }Alper

    acelik wrote:
    Thanks for the quick answer.
    The numbers are just wildly guesses, in order to keep the sample simple.
    Actually we develop a system for automobile industry. So, instead of customer, you may think of a company, like Ford. Account would be then Fiesta. Instead of AccTransaction we may think a huge number of car pieces (clima, motor, radio, etc.).
    So hierarchically we have
    Company (Ford, Opel, etc)
    Model (Fiesta, Astra, etc.)
    Piece (1000 pieces per model, so Fiesta, Opel have 1000 different pieces each)
    The problem is, if I loaded the Ford->Fiesta->1000x pieces for one view and then switch to another view. In the second view, I rename Fiesta to Fiesta II, and want to save this renaming operation using:
    What exactly does that represent?
    If you want to rename an existing car then you need logic to do exactly that. You do not copy the entire tree.
    If however you do want to copy the entire tree then that is in fact what you must do. Although I seriously doubt that there is a valid business requirement for that. In terms of efficiency though you could write a proc that did that rather than propogating the tree.
    Although further if you do in fact have two cars which use the same inventory item(s) then, again, you do not copy the entire tree because you are not creating a brand new inventory item. Instead you should only be pointing to an existing item.
    I wonder how this problem is solved smartly, if you guys share domain objects between the client and server, and avoid DTO.The first step is to start with actual business requirements.

  • What is the best way to store data to a file? Serialization?

    FYI: I am some what of a novice programer. I have almost finished my degree but everything I know about Java is self taught (never taken a course in java). Any way here is my question.
    So I have an example program that I have created. It basically just has three textpanes which also have the ability to contain images. Now I would like to learn how to store data to a file for later retrieval and decided to use a program such as this as an example. I am not sure if I should use the serialization API that java has or some other means such as XML. If I used XML I was not sure how to store the image data that would be contained in the text panes. I figured serialization would take care of that if I just serialized my main class and then restored it. So That is that I tried first. Is this a good direction to go?
    The problem I am having is that I cant seem to get the serialization to work the way I need it to. I am not sure what I am doing wrong because I have read many tutorials and looked at allot of example code but still dont understand. The tutorial I looked at most is [this one at IBM.|http://java.sun.com/developer/technicalArticles/Programming/serialization/]
    The eclipse project folder for my example program can be found here:
    [http://startoftext.com/stuff/myMenuExp/]
    zipped version:
    [http://startoftext.com/stuff/myMenuExp.zip]
    The main class is mainwindow.java. I know the source is kinda dirty. Any comments are welcome but I am most interested in how to solve this serialization problem. Thanks
    -James

    DrClap wrote:
    What will the nature of the data be? Just a handful of strings? A bunch of objects of different types reflecting the current state of your program to great depth and complexity? Something else?The data will be what is contained in three text panes. Each text pane containing rich text and images. For an example take a look at the example program in my first post.
    How will the data be used? Just write it out when the app shuts down, and read it all back in when it starts up? Do you need to query or search for specific subsets of the data? Is there any value in the stored form of the data being human-readable?Basically the data will need to be saved when the application shuts down or when the user selects save from the file menu. The data will be restored when the user opens the file from the file menu. It would be nice if the stored data is human readable but its not of primary importance.
    How often will the data be written and read? How many reads/writes/bytes/etc. per second/minute? Not often. Just a simple open and save from the file menu.
    How large could the data conceivably get?It will probably be a few paragraphs of formated text and less then a dozen images per text pane.
    Will reading and writing of the data need to occur concurrently?no.
    Do you need to add new data to the storage as your app goes along, or just replace what's there with the most current state?Replace with the most current state of the data.
    If it's a simple read once at startup, write once at shutdown, overwriting the previous data, read only by your app, not by humans, then serialization via ObjectInput/OutputStream is probably the way to go. If there are other requirements, you may want to go with XML serialization, a DB, or some other solution.Thanks for the information. Serialization sounds like the way to go. Even if I end up using XML serialization in the end it would still be of interest to me to learn how to use serialization without xml.
    I was trying to go with using serialization in be beginning but I cant seem to get it to work. Would you be willing to take a look at my example program. I attempted to implement serialization but it does not seem to work. Could you take a look and see what I am doing wrong. At this point I am stuck as i cant seem to get serialization to work.
    I am going to go ahead and mark this thread as answered because I think I already got most of the information I was looking for except what I am doing wrong with my attempt as serialization.
    Thank you jverd for your time.

  • Newbie mistake, but I can't find it, help appreciated on XML import

    I'm sure I'm making a newbie mistake but I can't find it. If someone could tell me what I'm doing wrong I would appreciate it.
    Step one works (i'm logged as user xdb on the database):
    SQL*Plus: Release 10.1.0.2.0 - Production on Wed Dec 20 13:47:53 2006
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL> Declare
    2 ignore boolean;
    3 begin
    4 ignore :=dbms_xdb.createFolder('/datamart');
    5 ignore :=dbms_xdb.createFolder('/datamart/CustomerCare');
    6 ignore :=dbms_xdb.createFolder('/datamart/CustomerCare/xsd');
    7 ignore :=dbms_xdb.createFolder('/datamart/CustomerCare/xml');
    8 commit ;
    9 end;
    10 /
    PL/SQL procedure successfully completed.
    Step two works, where I drag and drop via Windows Explorer my xsd file into http://d01db:8085/datamart/CustomerCare/xsd. It has a size of about 7k or so. Again, when connecting to the respository with Windows Explorer, I'm logging in as xdb.
    Step three works, where I register the schema that I just put into the XML repository. Still logged into SQLPlus as xdb.
    SQL> begin
    2 dbms_xmlschema.registerURI
    3 (schemaURL => 'http://xmlns.oracle.com/xdb/Steton.xsd'
    4 ,schemaDocURI => '/datamart/CustomerCare/xsd/Steton.xsd'
    5 ,genTables => true
    6 ) ;
    7 end;
    8 /
    PL/SQL procedure successfully completed.
    SQL> describe STETONAUDITRESULTS;
    Name Null? Type
    TABLE of SYS.XMLTYPE(XMLSchema "http://xmlns.oracle.com/xdb/Steton.xsd" Element "StetonAuditResults"
    SQL>
    By the way, here is the schema:
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" id="StetonAuditResults" xdb:storeVarrayAsTable="true">
         <xs:element name="StetonAuditResults" xdb:defaultTable="STETONAUDITRESULTS">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="Control">
                             <xs:complexType>
                                  <xs:sequence>
                                       <xs:element name="ResultCount" type="xs:int"/>
                                  </xs:sequence>
                             </xs:complexType>
                        </xs:element>
                        <xs:element name="AuditResults">
                             <xs:complexType>
                                  <xs:choice maxOccurs="unbounded">
                                       <xs:element name="AuditResult">
                                            <xs:complexType>
                                                 <xs:sequence>
                                                      <xs:element name="AuditResultGlobalID" type="xs:string" minOccurs="0"/>
                                                      <xs:element name="AuditGlobalID" type="xs:string" minOccurs="0"/>
                                                      <xs:element name="AuditName" type="xs:string" minOccurs="0"/>
                                                      <xs:element name="AccountID" type="xs:string" minOccurs="0"/>
                                                      <xs:element name="AccountName" type="xs:string" minOccurs="0"/>
                                                      <xs:element name="AuditorID" type="xs:string" minOccurs="0"/>
                                                      <xs:element name="AuditorName" type="xs:string" minOccurs="0"/>
                                                      <xs:element name="AcctRepName" type="xs:string" minOccurs="0"/>
                                                      <xs:element name="AuditTypeID" type="xs:int" minOccurs="0"/>
                                                      <xs:element name="AuditTypeName" type="xs:string" minOccurs="0"/>
                                                      <xs:element name="DivisionID" type="xs:int" minOccurs="0"/>
                                                      <xs:element name="FaxBack" type="xs:string" minOccurs="0"/>
                                                      <xs:element name="EMailBack" type="xs:string" minOccurs="0"/>
                                                      <xs:element name="StartDateLocal" type="xs:dateTime" minOccurs="0"/>
                                                      <xs:element name="StartDateUTC" type="xs:dateTime" minOccurs="0"/>
                                                      <xs:element name="EndDate" type="xs:dateTime" minOccurs="0"/>
                                                      <xs:element name="UploadDate" type="xs:dateTime" minOccurs="0"/>
                                                      <xs:element name="ProcessDate" type="xs:dateTime" minOccurs="0"/>
                                                      <xs:element name="ApplicationVersion" type="xs:string" minOccurs="0"/>
                                                      <xs:element name="AuditResultNotes" type="xs:string" minOccurs="0"/>
                                                      <xs:element name="AuditorSignature" type="xs:base64Binary" minOccurs="0"/>
                                                      <xs:element name="AcctRepSignature" type="xs:base64Binary" minOccurs="0"/>
                                                      <xs:element name="InitialAuditResultGlobalID" type="xs:string" minOccurs="0"/>
                                                      <xs:element name="RecordType" type="xs:string" minOccurs="0"/>
                                                      <xs:element name="ModifiedDate" type="xs:dateTime" minOccurs="0"/>
                                                      <xs:element name="CategoryResults">
                                                           <xs:complexType>
                                                                <xs:choice minOccurs="0" maxOccurs="unbounded">
                                                                     <xs:element name="CategoryResult">
                                                                          <xs:complexType>
                                                                               <xs:sequence>
                                                                                    <xs:element name="AuditResultGlobalID" type="xs:string"/>
                                                                                    <xs:element name="CategoryGlobalID" type="xs:string" minOccurs="0"/>
                                                                                    <xs:element name="CategoryName" type="xs:string" minOccurs="0"/>
                                                                                    <xs:element name="CategoryReference" type="xs:string" minOccurs="0"/>
                                                                                    <xs:element name="CategoryResultNotes" type="xs:string" minOccurs="0"/>
                                                                                    <xs:element name="QuestionResults">
                                                                                         <xs:complexType>
                                                                                              <xs:choice minOccurs="0" maxOccurs="unbounded">
                                                                                                   <xs:element name="QuestionResult">
                                                                                                        <xs:complexType>
                                                                                                             <xs:sequence>
                                                                                                                  <xs:element name="AuditResultGlobalID" type="xs:string"/>
                                                                                                                  <xs:element name="CategoryGlobalID" type="xs:string" minOccurs="0"/>
                                                                                                                  <xs:element name="QuestionGlobalID" type="xs:string" minOccurs="0"/>
                                                                                                                  <xs:element name="QuestionText" type="xs:string" minOccurs="0"/>
                                                                                                                  <xs:element name="QuestionReference" type="xs:string" minOccurs="0"/>
                                                                                                                  <xs:element name="ChoiceGlobalID" type="xs:string" minOccurs="0"/>
                                                                                                                  <xs:element name="ChoiceText" type="xs:string" minOccurs="0"/>
                                                                                                                  <xs:element name="ChoicePointsPossible" type="xs:double" minOccurs="0"/>
                                                                                                                  <xs:element name="ChoicePointsEarned" type="xs:double" minOccurs="0"/>
                                                                                                                  <xs:element name="QuestionResultNotes" type="xs:string" minOccurs="0"/>
                                                                                                                  <xs:element name="QuestionCommentResults">
                                                                                                                       <xs:complexType>
                                                                                                                            <xs:choice minOccurs="0" maxOccurs="unbounded">
                                                                                                                                 <xs:element name="QuestionCommentResult">
                                                                                                                                      <xs:complexType>
                                                                                                                                           <xs:sequence>
                                                                                                                                                <xs:element name="AuditResultGlobalID" type="xs:string"/>
                                                                                                                                                <xs:element name="CategoryGlobalID" type="xs:string" minOccurs="0"/>
                                                                                                                                                <xs:element name="QuestionGlobalID" type="xs:string" minOccurs="0"/>
                                                                                                                                                <xs:element name="QuestionCommentGlobalID" type="xs:string" minOccurs="0"/>
                                                                                                                                                <xs:element name="QuestionCommentText" type="xs:string" minOccurs="0"/>
                                                                                                                                                <xs:element name="QuestionCommentResultNotes" type="xs:string" minOccurs="0"/>
                                                                                                                                           </xs:sequence>
                                                                                                                                      </xs:complexType>
                                                                                                                                 </xs:element>
                                                                                                                            </xs:choice>
                                                                                                                       </xs:complexType>
                                                                                                                  </xs:element>
                                                                                                             </xs:sequence>
                                                                                                        </xs:complexType>
                                                                                                   </xs:element>
                                                                                              </xs:choice>
                                                                                         </xs:complexType>
                                                                                    </xs:element>
                                                                               </xs:sequence>
                                                                          </xs:complexType>
                                                                     </xs:element>
                                                                </xs:choice>
                                                           </xs:complexType>
                                                      </xs:element>
                                                 </xs:sequence>
                                            </xs:complexType>
                                       </xs:element>
                                  </xs:choice>
                             </xs:complexType>
                        </xs:element>
                   </xs:sequence>
              </xs:complexType>
              <xs:key name="StetonAuditResultsKey_AuditResult">
                   <xs:selector xpath=".//AuditResult"/>
                   <xs:field xpath="AuditResultGlobalID"/>
              </xs:key>
              <xs:key name="StetonAuditResultsKey_CategoryResult">
                   <xs:selector xpath=".//CategoryResult"/>
                   <xs:field xpath="AuditResultGlobalID"/>
                   <xs:field xpath="CategoryGlobalID"/>
              </xs:key>
              <xs:key name="StetonAuditResultsKey_QuestionResult">
                   <xs:selector xpath=".//QuestionResult"/>
                   <xs:field xpath="AuditResultGlobalID"/>
                   <xs:field xpath="CategoryGlobalID"/>
                   <xs:field xpath="QuestionGlobalID"/>
              </xs:key>
              <xs:keyref name="AuditResultCategoryResult" refer="StetonAuditResultsKey_AuditResult">
                   <xs:selector xpath=".//CategoryResult"/>
                   <xs:field xpath="AuditResultGlobalID"/>
              </xs:keyref>
              <xs:keyref name="CategoryResultQuestionResult" refer="StetonAuditResultsKey_CategoryResult">
                   <xs:selector xpath=".//QuestionResult"/>
                   <xs:field xpath="AuditResultGlobalID"/>
                   <xs:field xpath="CategoryGlobalID"/>
              </xs:keyref>
              <xs:key name="StetonAuditResultsKey_QuestionCommentResult">
                   <xs:selector xpath=".//QuestionCommentResult"/>
                   <xs:field xpath="AuditResultGlobalID"/>
                   <xs:field xpath="CategoryGlobalID"/>
                   <xs:field xpath="QuestionGlobalID"/>
                   <xs:field xpath="QuestionCommentGlobalID"/>
              </xs:key>
              <xs:keyref name="QuestionResultlQuestionCommentResult" refer="StetonAuditResultsKey_QuestionResult">
                   <xs:selector xpath=".//QuestionCommentResult"/>
                   <xs:field xpath="AuditResultGlobalID"/>
                   <xs:field xpath="CategoryGlobalID"/>
                   <xs:field xpath="QuestionGlobalID"/>
              </xs:keyref>
         </xs:element>
    </xs:schema>
    Step four is where I have problems. I'm using Windows Explorer to drag and drop an XML instance document into http://d01db:8085/datamart/CustomerCare/xml while logged into the repository as xdb.
    Here's some of the test file that I'm using.
    <?xml version="1.0" standalone="no"?>
    <StetonAuditResults xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/xdb/Steton.xsd">
         <Control>
              <ResultCount>112</ResultCount>
         </Control>
    </StetonAuditResults>
    Note, the test XML file is 427k in size and I can't post it here. There is a lot of data between the </Control> tag and the </StetonAuditResults> tag.
    During the Drag and Drop I get the message "An error occured copying some or all of the selected files."
    My first suspicision was that the XML document failed validation. So I changed the namespace line to
    <StetonAuditResults xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="H:\StetonCustomerCare\Steton.xsd">
    I then started Altova's XMLSpy and the XML document is well formed and it validates.
    I then changed the namespace line in the XML document to
    <StetonAuditResults xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    and I could use Windows Explorer to drag and drop the file into the XML DB respository of http://d01db:8085/datamart/CustomerCare/xml, but this version doesn't shred the XML document into the SQL tables that I need.
    I then deleted the file from the repository.
    I then changed the namespace line in the XML document to <StetonAuditResults xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Steton.xsd">
    because someone told me to, and because I have seen an FAQ in this forum suggest this approach. I can copy using Windows Explorer into the http://d01db:8085/datamart/CustomerCare/xml. However, the file size via Windows Explorer is 427kb. Also "select count(*) from STETONAUDITRESULTS;" returns zero.
    What am I doing wrong?
    My background, I'm not an Oracle DBA, but I can code SQL select statements. So if I need to do something involving Oracle DBA privileges, please document it well. I will have to get the DBA's involved.
    My goal is import this XML file so that I can use it as a feed for a datamart. The first XML file in text format is 27mb.
    Thanks again for reading this far.

    I guess you have a namespace issue...(schema registered is not the same as the layout in your XML instance/doc, therefor will not be inserted). You have access to the XDB account...thats all you need (more then enough, i mean, you don't need dba privs).
    on the FAQ Mark explains...
    Why is the size of my XML document 0 bytes when viewed via HTTP or FTP ?
    Posted: Sep 1, 2006 6:07 AM in response to: mdrake in response to: mdrake      
    When a schema based XML is loaded into the XML DB repository via HTTP, FTP or dbms_xdb.createResource() the document is converted from a textual serialization of XML into a series of objects. At this point the size of the document becomes (a) meaningless and (b) difficult / expensive to calculate.
    The first question is what is meant by the size of the document once it has been stored using object-based persistence ? There are two possibilities
    (1) The number of bytes used the text serialization of the XML document.
    (2) The number of bytes required to store the internal object representation of the document. In this case the does the size include the bytes used for keys, refs indexes, etc ?
    Since (1) would be expensive to maintain as the document is updated (particularly in the case of partial updates) and (2) is expensive to calculate on a document by document basis, XML DB shows the size of all schema based XML documents as 'zero' bytes.
    Note that this also applies to the size of the registered version of XML Schema documents, which can be found in the folder tree /sys/schemas.
    If a schema based XML document is loaded into the repository and does not appear as 0 bytes long when viewed via HTTP or WebDAV this means that XML DB was unable to identifiy the XML schema the XML document is associated with.
    Note that immediatlely after uploading a document in Windows Explorer using the WebDAV protocol the size of the document will be non-zero, since the original size is cached by the Microsoft WebDAV client. However once a refresh of the folder is performed in Windows Explorer the size should be shown as zero if the document was recognized as a schema based document.

  • Serialization in SAP R/3

    Dear all,
    In one of the interface flow, we are expecting a batch of  IDOCs from SAP R/3 in a serial order, which is not happening right now.
    I want to know, if there is a option/function module to enable serialization from SAP R/3.
    Kindly pour in your comments.
    Regards,
    Younus

    This could help you...
    /people/community.user/blog/2006/11/04/how-to-serialize-idoc-xml-messages-fed-into-xi
    http://help.sap.com/saphelp_erp2004/helpdata/en/bd/277264c3ddd44ea429af5e7d2c6e69/content.htm
    http://help.sap.com/saphelp_erp2004/helpdata/en/0b/2a66d6507d11d18ee90000e8366fc2/content.htm
    /people/sap.user72/blog/2005/01/28/setting-up-inbound-qrfc-queues-for-serializing-idocs-using-the-idoc-adapter

  • Converting string xml to xsd format ?

    Hi,
    my web service receives a xml as an input in string format.
    it is passed to other web services for processing purpose.
    during execution of each web service, I need to extract some node values multiple times which causes performance overhead.
    can I convert the input xml (as string) into xsd structure (similar to OTD) so that I can simply map it while passing it to other web services? it should save me unnecessary extraction of same nodes in other web services.
    how to do it?
    is there any better approach for this?
    suraj

    Within the JBI environment, the XML message is typically passed around as a DOM Document (wrapped as a TRAX DOMSource), so the document is parsed only once. This should be very quick, even when evaluating XPath functions to find parts of the document repeatedly. DOM and OTD aren't that dissimilar, so you should be comfortable with it.
    When sending the XML message "across the wire", you are forced to serialize to XML again. This is the foundation of interoperability and loose coupling.
    Sometimes converting the XML to a more convenient form (different schema) can help make it easier/quicker to run queries against.

  • XML to complex/deep ABAP structure

    Has anyone successfully used Function module
    SDIXML_DOM_TO_DATA (& related SDIXML* Function modules) to convert XML string into complex ABAP structure?
    I am using WAS 6.40 (ECC) and I was hoping that if the XML & the ABAP structure you pass as function module parameter do match in strcture, then this Function module should automatically convert (ie, de-serialize) the XML into ABAP structure - Without having to write any XSLT or ST (Simple Transformation) files !
    Any ideas? Any other Function module? The ABAP structure I want to be populated is a "deep structure" with many levels and tables at various levels etc..
    Thanks a lot

    Hi Janet Lam,
    Here's an article explaining mapping between XML and ABAP structures.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/2e98a690-0201-0010-3b90-cda224bad152
    Dont forget to reward pts, if it helps ;>)
    Regards,
    Rakesh.

Maybe you are looking for

  • My Titan died!!! Does the GT80 Titan have a reset switch?

    Greetings, When I purchased my GT80 Titan notebook a few weeks ago, I knew that it didn't have a user-removable battery. But I was shocked that I couldn't find a reset switch when I needed one! After working late Friday night, I turned off my Titan.

  • My emails are Blank!  Empty content since 10.18am this morning...

    Just want to second this - I woke up this morning to find some of my emails displaying blank/empty content... It turns out that the blank emails are everything incoming since a certain time (10.18am). This was half way through my mail session - all b

  • Using different UOMs for same material (stock, production, sales)

    Hi, here is our scenario: 1. A material that we sell is 10 meters long in its full length. 2. We want to be able to sell it in any length. E.g. 2 meters, 4 meters, 5 meters, etc. 3. The by-product will be 10 meters - the sold length and should be kep

  • How can Client get a ejb remoteinterface class through ejbhomeinterface?

    HI,I've got ejbhomeinterface class(ejbhomeinterface class is on my local machine),How can i get ejb remoteinterface class(it is on remote app server) ? I've tried getEJBMetaData() method, but throw class not found exception,pls help me,thank you very

  • How well does Vista Ultimate run? Worth getting?

    Hey everyone, I have XP installed right now on my macbook pro to play Lord of the Rings Online and Counter-Strike Source. My college is offering Vista SP1 Ultimate for VERY cheap! Is it worth upgrading to Vista on a macbook pro? Also is it worth gett