XML (un)marshalling with JAXB and "any" blocks

I have 2 very simple XSD schema's.
SchemaA.xsd:
[request]-------[element_A] is xs:string
|__(ANY)
SchemaB.xsd:
[body]--------[element_B] is xs:string
The any block says that there can follow any type of xml after the element_a.
In the xsd it is coded as: <xs:any />
I compiled both schema's with jaxb, using this command line:
xjc SchemaA.xsd -p test.request
xjc SchemaB.xsd -p test.body -use-runtime test.request.impl.runtime
I created the following code :
test.request.ObjectFactory of1 = new test.request.ObjectFactory();
test.body.ObjectFactory of2 = new test.body.ObjectFactory();
Request r = of1.createRequest();
r.setElementA("testing, element one");
Body b = of2.createBody();
b.setElementB("testing, element two");
r.setAny(b);
Marshaller m = of1.createMarshaller();
m.marshal(r,System.out);
And the result is what I expected:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<request><element_a>testing, element one</element_a><body><element_b>testing, element two</element_b></body></request>
JAXB added the xml from the second schema to the first.
Ok, so far so good. Now I'm trying to do it the other way around, I want to unmarshall that XML to objects again:
String xml <- contains the outputted xml from the marshall (as pasted a few lines above)
Unmarshaller um = of1.createUnmarshaller();
Request r2 = (Request)um.unmarshal(new ByteArrayInputStream(xml.getBytes()));
System.err.println(r2.getElementA());
System.err.println(r2.getAny());
The output:
testing, element one
null
now, the first message is good. The second is not however...why is the "getAny" null ? I can't figure this one out. In the best possible case it should return an object that can be cast to "Body" .
In the worst case it should just return the "<Body> ...." xml as string. But not null ...
Any help on this is appreciated !

JAXB does not support xs:any

Similar Messages

  • Marshalling with JaxB and HyperJaxb

    Hi guys,
    Can you guys help me based on what is happening below? What I don't
    understand is that HyperJaxB inserts the data fine. I only have
    this problem when pulling it out.
    In the schema, the element type is stated with minoccurs=0. It is true, that sometimes the data may or may not be present. I have also added nillable="true" to the XSD, but this doesn't seem to make a difference.
    Doing some more research on the problem, I discovered that it is
    because some of the XML types in my schema are optional. They occur
    in some documents and not others of the same type.
    Thanks,
    I am getting a null pointer exception as shown below:
    java.lang.NullPointerException
         at org.midwestiso.markets.markets.xml.impl.runtime.Util.getUserFriendlyTypeName(Util.java:71)
         at org.midwestiso.markets.markets.xml.impl.runtime.Util.handleTypeMismatchError(Util.java:56)
         at org.midwestiso.markets.markets.xml.impl.MKTDETTYPTypeImpl.serializeURIs(MKTDETTYPTypeImpl.java:137)
         at org.midwestiso.markets.markets.xml.impl.runtime.SAXMarshaller.childAsURIs(SAXMarshaller.java:419)
         at org.midwestiso.markets.markets.xml.impl.DASTLMTTypeImpl.serializeBody(DASTLMTTypeImpl.java:251)
         at org.midwestiso.markets.markets.xml.impl.DASTLMTImpl.serializeBody(DASTLMTImpl.java:50)
         at org.midwestiso.markets.markets.xml.impl.runtime.SAXMarshaller.childAsBody(SAXMarshaller.java:391)
         at org.midwestiso.markets.markets.xml.impl.runtime.MarshallerImpl.write(MarshallerImpl.java:171)
         at org.midwestiso.markets.markets.xml.impl.runtime.MarshallerImpl.marshal(MarshallerImpl.java:144)
         at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:66)
         at com.transalta.miso.model.factory.SettlementTypeFactory.retrieveSettlements(SettlementTypeFactory.java:254)
         at com.transalta.miso.model.system.WebScrapeHandler.execute(WebScrapeHandler.java:146)
         at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
         at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)

    JAXB does not support xs:any

  • Hi, I have a specific website that keeps blocking me from going to website I want to view.  It is called vnebo.pro or mobi. I also have a pc computer with Kaspersky and it blocks it.  How do I remove it or block it from my computer.

    Hi,
    I have a specific website that keeps blocking me from going to website I want to view.  It is called vnebo.pro or mobi. I also have a pc computer with Kaspersky and it blocks it.  How do I remove it or block it from my computer?  It only appears at my home, when I use my mac at other places I don't have a problem.
    Thanks for any help!

    Thank you for the reply. I wanted to wait awhile in order to ensure that this corrected the issue. For a brief while, it did! However, it did not take long before the screen began once again hijacking my home button presses. This occurs even with Firefox removed from default applications ( triple-checked ).
    This never happened before version 35.

  • I have a Apple imax only about 9 months old. I need a new printer. I am looking at a Canon MX926 PIXMA. Do I have Airprint or do I need to purchase it? I am a novice with Apple and any assistance would be greatly appreciated.

    I have a Apple imax only about 9 months old. I need a new printer. I am looking at a Canon MX926 PIXMA. Do I have Airprint or do I need to purchase it? I am a novice with Apple and any assistance would be greatly appreciated.

    Welcome to Apple Support Communities
    If your iMac is only 9 months old, it probably comes with OS X Mountain Lion, and it includes AirPrint, so you do not need to purchase anything else apart from the printer (which is compatible with AirPrint).
    Once you have purchased the printer, you need to follow the steps of the manufacturer. To add the printer to OS X, see > http://support.apple.com/kb/HT4670

  • Can an arbitrary object be marshalled with JAXB?

    Is it possible to marshall an arbitrary Java object with JAXB?
    I would think this is possible if
    (i) marshalling works on non-public fields
    (ii) xml can handle all Java primitive types, including byte[]
    And, it it is possible, how would you unmarshall it?
    bw

    I don't believe it is possible for JAXB to marshal and un-marshal an arbitrary object. Your object would need to implement the MarshallableObject. Usually with JAXB you wouldn't actually create the MarshallableObject yourself, you would just create it from your binding schema and DTD.

  • HTML content with images and links blocked

    Hello,
    I very much need some help here because my company needs to send out newsletters to our clients in HTML format soon and so far the email with HTML content is being blocked as spam while text content works fine. Specifically, whenever I add a link or an image in HTML content, the email doesn't go through. I tried sending in multipart format but it is also not sending HTML with images and links. Here is my attempt:
                                    props.setProperty("mail.transport.protocol", "smtp");
                                     props.setProperty("mail.host", "mail.server.com");
                                     props.setProperty("mail.user", "joeuser");
                                     Session mailSession = Session.getDefaultInstance(props, null);
                                     mailSession.setDebug(true);
                                     Transport transport = mailSession.getTransport();
                                     MimeMultipart mp = new MimeMultipart("alternative");
                                     MimeBodyPart htmlPart = new MimeBodyPart();
                                     MimeBodyPart textPart = new MimeBodyPart();
                                     textPart.setText("Just to make it multipart");
                                     htmlPart.setHeader("MIME-Version", "1.0");
                                     htmlPart.setHeader("Content-Type", htmlPart.getContentType());
                                     htmlPart.setContent(strHtmlMessage, "text/html");
                                     mp.addBodyPart(textPart);
                                     mp.addBodyPart(htmlPart);
                                     MimeMessage message = new MimeMessage(mailSession);
                                     message.setHeader("MIME-Version", "1.0");
                                     message.setHeader("Content-Type", mp.getContentType());
                                     message.setHeader("X-Mailer", "Recommend-It Mailer V2.03c02");
                                     message.setContent(mp);
                                     message.setSubject(strSubject);
                                     message.setFrom(new InternetAddress("[email protected]"));
                                     message.addRecipient(Message.RecipientType.TO,
                                             new InternetAddress("[email protected]"));
                                             transport.connect();
                                             transport.sendMessage(message,
                                             message.getRecipients(Message.RecipientType.TO));
                                     transport.close();This code is one of my numerous attempts to make HTML send images and links. Please, let me know if there is a workaround way to make JavaMail send HTML with links and images in the message body. Your help will be greatly appreciated.

    The JavaMail FAQ has information on creating HTML messages, including
    messages with both plain text and HTML. Did you find it?
    BTW, your code has many unnecessary statements, such as setting
    the Mime-Version header, which JavaMail will do for you, and setting
    the Content-Type header, which JavaMail does as a side-effect of the
    setContent or setText calls.
    Other than that, it looks like your code should be correctly creating a
    multipart/alternative message. If the recipient is still rejecting it you
    need to figure out what it is about the message that makes the recipient
    think it's spam. Can you send a similar message using another mailer?
    Can you send the message to a different recipient?

  • Keyword filtering with 'all' and 'any' not working

    Hi folks,
    At the moment I'm testdriving Aperture 1.5.3, and it seems that when filtering on multiple keywords the logical connection 'any' or 'all' doesn't work.
    For instance, the filtersetting is 'Match all of the following:'
    [checked] Yosamite Sam
    [checked] Bugs Bunny
    [unchecked] Daffy Duck
    This would mean I should see all pictures tagged with both the keywords 'Yosamite Sam' AND 'Bugs Bunny'. In stead of that, the result of the filter is all pictures tagged with 'Yosamite Sam' OR 'Bugs Bunny' OR both.
    Is this a known issue and is already a fix for this?
    Greetz,
    Seeta

    I had the same problem when I started using Aperture. The 'Match all/any of the following' is referred to the different searching options (by date, by keyword, by rating...)
    If you need to search for images with all or any of the keywords ticked use the 'contain one or more of the following' or 'contain all of the following' beside the keyword title on the searching window.

  • Using OleDbDataAdapter Update with InsertCommands and getting blocking locks on Oracle table

    The following code snippet shows the use of OleDbDataAdapter with InsertCommands.  This code is producing many inserts on the Oracle table and is now suffering from contention... all on the same table.  How does the OleDbDataAdapter produce
    inserts from a dataset... what characteristics do these inserts inherent in terms of batch behavior... or do they naturally contend for the same resource. 
    oc.Open();
    for (int i = 0; i < xImageId.Count; i++)
    // Create the oracle adapter using a SQL which will not return any actual rows just the structure
    OleDbDataAdapter da =
       new OleDbDataAdapter("SELECT BUSINESS_UNIT, INVOICE, ASSIGNMENT_ID, END_DT, RI_TIMECARD_ID, IMAGE_ID, FILENAME, BARCODE_LABEL_ID, " +
       "DIRECT_INVOICING, EXCLUDE_FLG, DTTM_CREATED, DTTM_MODIFIED, IMAGE_DATA, PROCESS_INSTANCE FROM sysadm.PS_RI_INV_PDF_MERG WHERE 1 = 2", oc);
    // Create a data set
    DataSet ds = new DataSet("documents");
    da.Fill(ds, "documents");
    // Loop through invoices and write to oracle
    string[] sInvoices = invoiceNumber.Split(',');
    foreach (string sInvoice in sInvoices)
        // Create a data set row
        DataRow dr = ds.Tables["documents"].NewRow();
        ... map the data
        // Populate the dataset
        ds.Tables["documents"].Rows.Add(dr);
    // Create the insert command
    string insertCommandText =
        "INSERT /*+ append */ INTO PS_table " +
        "(SEQ_NBR, BUSINESS_UNIT, INVOICE, ASSIGNMENT_ID, END_DT, RI_TIMECARD_ID, IMAGE_ID, FILENAME, BARCODE_LABEL_ID, DIRECT_INVOICING, " +
        "EXCLUDE_FLG, DTTM_CREATED, DTTM_MODIFIED, IMAGE_DATA, PROCESS_INSTANCE) " +
        "VALUES (INV.nextval, :BUSINESS_UNIT, :INVOICE, :ASSIGNMENT_ID, :END_DT, :RI_TIMECARD_ID, :IMAGE_ID, :FILENAME,  " +
        ":BARCODE_LABEL_ID, :DIRECT_INVOICING, :EXCLUDE_FLG, :DTTM_CREATED, :DTTM_MODIFIED, :IMAGE_DATA, :PROCESS_INSTANCE)";
    // Add the insert command to the data adapter
    da.InsertCommand = new OleDbCommand(insertCommandText);
    da.InsertCommand.Connection = oc;
    // Add the params to the insert
    da.InsertCommand.Parameters.Add(":BUSINESS_UNIT", OleDbType.VarChar, 5, "BUSINESS_UNIT");
    da.InsertCommand.Parameters.Add(":INVOICE", OleDbType.VarChar, 22, "INVOICE");
    da.InsertCommand.Parameters.Add(":ASSIGNMENT_ID", OleDbType.VarChar, 15, "ASSIGNMENT_ID");
    da.InsertCommand.Parameters.Add(":END_DT", OleDbType.Date, 0, "END_DT");
    da.InsertCommand.Parameters.Add(":RI_TIMECARD_ID", OleDbType.VarChar, 10, "RI_TIMECARD_ID");
    da.InsertCommand.Parameters.Add(":IMAGE_ID", OleDbType.VarChar, 8, "IMAGE_ID");
    da.InsertCommand.Parameters.Add(":FILENAME", OleDbType.VarChar, 80, "FILENAME");
    da.InsertCommand.Parameters.Add(":BARCODE_LABEL_ID", OleDbType.VarChar, 18, "BARCODE_LABEL_ID");
    da.InsertCommand.Parameters.Add(":DIRECT_INVOICING", OleDbType.VarChar, 1, "DIRECT_INVOICING");
    da.InsertCommand.Parameters.Add(":EXCLUDE_FLG", OleDbType.VarChar, 1, "EXCLUDE_FLG");
    da.InsertCommand.Parameters.Add(":DTTM_CREATED", OleDbType.Date, 0, "DTTM_CREATED");
    da.InsertCommand.Parameters.Add(":DTTM_MODIFIED", OleDbType.Date, 0, "DTTM_MODIFIED");
    da.InsertCommand.Parameters.Add(":IMAGE_DATA", OleDbType.Binary, System.Convert.ToInt32(filedata.Length), "IMAGE_DATA");
    da.InsertCommand.Parameters.Add(":PROCESS_INSTANCE", OleDbType.VarChar, 10, "PROCESS_INSTANCE");
    // Update the table
    da.Update(ds, "documents");

    Here is what Oracle is showing as blocking locks and the SQL that has been identified with each of the SIDS.  Not sure why there is contention.  There are no triggers or joined tables in this piece of code.
    Here is the SQL all of the SIDs below are running:
    INSERT INTO sysadm.PS_RI_INV_PDF_MERG (SEQ_NBR, BUSINESS_UNIT, INVOICE, ASSIGNMENT_ID, END_DT, RI_TIMECARD_ID, IMAGE_ID, FILENAME, BARCODE_LABEL_ID, DIRECT_INVOICING, EXCLUDE_FLG, DTTM_CREATED, DTTM_MODIFIED, IMAGE_DATA, PROCESS_INSTANCE) VALUES (SYSADM.INV_PDF_MERG.nextval,
    :BUSINESS_UNIT, :INVOICE, :ASSIGNMENT_ID, :END_DT, :RI_TIMECARD_ID, :IMAGE_ID, :FILENAME, :BARCODE_LABEL_ID, :DIRECT_INVOICING, :EXCLUDE_FLG, :DTTM_CREATED, :DTTM_MODIFIED, :IMAGE_DATA, :PROCESS_INSTANCE)
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1150 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1156 (BTSUSER,biztprdi,BTSNTSvc64.exe) in instance FSLX3
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 6 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX2
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1726 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX2
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 2016 (BTSUSER,biztprdi,BTSNTSvc64.exe) in instance FSLX2

  • XML file validation with XSD and loading to database relational table

    Hi all,
    I have some xml files coming to my unix directory. I will be having an XSD for those. My task is to validate those xml against given xsd and load the corresponding data into oracle relational tables with sqlloader only.
    Please help me to accomplish. and let me know the contents of control file ( for SQLLOADER) if i want to load the xml directly to database.
    Unix and/or PLSQL suggestions both are welcome.

    My problem area is loading the XML to Oracle relational tables using sqlloader.
    suppose, the xml is <?xml version="1.0"?>
    <Customers>
    <Customer>
    <CustID>1</CustID>
    <Company>Bell South</Company>
    <City>New York</City>
    </Customer>
    <Customer>
    <CustID>2</CustID>
    <Company>Barnes &amp; Noble</Company>
    <City>New York</City>
    </Customer>
    <Customer>
    <CustID>3</CustID>
    <Company>Comp USA</Company>
    <City>Tampa</City>
    </Customer>
    <Customer>
    <CustID>4</CustID>
    <Company>Borders</Company>
    <City>Charlotte</City>
    </Customer>
    </Customers>
    and I have a relational table
    CREATE TABLE CUSTOMERS
    CUSTID NUMBER,
    COMPANY VARCHAR2(100 BYTE),
    CITY VARCHAR2(100 BYTE)
    how to insert the xml data into the table???
    please help..
    Edited by: nuon on Oct 25, 2010 6:25 AM

  • Generics with JAXB and Unchecked Conversions

    If there is a more appropriate forum for JAXB related posts, my apologies, I browsed the list and didn't see one.
    Here's my schema:
         </complexType>
         <element name="songList"
              type="com:songListType"/>
         <complexType name="songListType">
              <sequence>
                   <element name="songList"
                        type="string" minOccurs="0" maxOccurs="unbounded"/>
              </sequence>
         </complexType>And my question os
    Is there a way to get JAXB to generate a class that has a method lie
    List<String> getSongList();Instead of
    List getSongList();I'd like to eliminate the unchecked conversions. If anyone has any suggestions or can reference a tutorial, I'd greatly appreciate some tips.
    Thanks

    Wow, sorry for all the typos btw

  • Regarding Ranges : to search for a patter which starts with 0 and any no: 0

    HI,
    My requirement is to use ranges on LIFNR to select data from EKKO.
    Here, I need to give 000123 for a vendor 123. ie, I need to prefix zeros.
    The problem is I cannot use any pattern here.. like if I give 12*, the conversion exit will give a dump.
    Is there any pattern to specify <0(or any occurance of 0)>12.*
    Thanks in advance,
    Sreekanth
    Edited by: Sreekanth Krishnan on Dec 1, 2009 7:46 AM

    hai sreekanth,
    try given Below program, May be helpful For u.....
    TABLES LFA1.
    data : begin of ivendor OCCURS 10,
           lifnr like lfa1-lifnr,
           end of ivendor.
    data: iekko like ekko OCCURS 10 WITH HEADER LINE.
    SELECT-OPTIONS : VENDOR FOR LFA1-LIFNR.
    INITIALIZATION.
    VENDOR-LOW    =   1000.        " It specifies the range starting value.
    VENDOR-HIGH    =   2000.       " It specifies the range ending value.
    VENDOR-OPTION  =  'BT'.        " specifies ranges value is in between.
    VENDOR-SIGN      = 'I'.           "specifies both inclussive.
    APPEND VENDOR.
    shift vendor-low LEFT DELETING LEADING space.
    shift vendor-high LEFT DELETING LEADING space.
    ivendor-lifnr = vendor-low.
    CONCATENATE '000' ivendor-lifnr into ivendor-lifnr.
    append ivendor.
    loop at ivendor.
    if ivendor-lifnr+3(6) <> vendor-high.
    ivendor-lifnr = ivendor-lifnr + 1.
    shift ivendor-lifnr LEFT DELETING LEADING space.
    CONCATENATE '000' ivendor-lifnr into ivendor-lifnr.
    append ivendor.
    endif.
    endloop.
    select * from ekko into table iekko for all ENTRIES IN ivendor
                                      where lifnr = ivendor-lifnr.

  • Does the iPod need the Pod driver to work with XP and any iPod

    I want to load iTunes 6 on 120 XP workstations. The problem tho is that I do not want my users to connect up their personal iPods to the company's computers. The purpose is so that they can gain access to the iTunes music store expressly for work purposes.
    If I continue down this road and install ONLY iTunes 6, if a user connects their iPod will it communicate with their iPod?
    Disabling the USB ports is not an option as I have other permitted USB devices such as mice and keyboards.
    Thanks....

    You could try to disable the "iPodService" (and perhaps the "iTunesHelper" as well) on these machines. The iPod would still function as an external hard drive, as hudgie pointed out, but iTunes should not be able to upload music to the iPod anymore.
    Just give it a try.
    Alexander.

  • Problems with IO7 and the block of complete download of many app

    I have many problems after download of IO7 with password for Appstore and overall I can't complete the updatings of all the App that need it. Thanks

    Try a reset: Simultaneously hold down the Home and On buttons until the device shuts down. Ignore the off slider if it appears. Once shut down is complete, if it doesn't restart on it own, turn the device back on using the On button. In some cases it also helps to double click the Home button and close all apps BEFORE doing the reset.

  • IPhone synchronized with iTunes and lost songs, why?

    I synchronized my iPhone with iTunes and any one of my songs are gone and the iPhone does not appear in iTunes, it takes a lot to recover, because I have an important recording to be delivered to my lawyer!
    Please help me out!

    CJ201188 wrote:
    I synced my iphone 4S with my itunes on my Macbook Pro and now my iphone looks just like my Ipod Touch does
    It was not synced, it was restored with a backup from your iPod Touch.

  • Marshalling HashMap with JAXB 2.0 - empty tags & ill schema

    Hi all,
    I expected JAXB 2.0 to be capable to handle basic classes like HashMap, but it does not look so. I have two classes: SimpleNegotiationManager which has a property HashMap in which are stored the instances of SimpleInitiatedConversation:
    package xml;
    import javax.xml.bind.annotation.*;
    import java.util.HashMap;
    @XmlAccessorType(AccessType.FIELD)
    @XmlRootElement
    public class SimpleNegotiationManager {
        @XmlElement
        protected HashMap<String, SimpleInitiatedConversation> initiatedConversations;
        public SimpleNegotiationManager() {
        public HashMap<String, SimpleInitiatedConversation> getInitiatedConversations() {
            if (initiatedConversations == null) {
                initiatedConversations = new HashMap();
            return initiatedConversations;
        public void setInitiatedConversations(HashMap<String, SimpleInitiatedConversation> initiatedConversations) {
            this.initiatedConversations = initiatedConversations;
    }and
    package xml;
    import javax.xml.bind.annotation.*;
    import java.util.ArrayList;
    import java.util.List;
    @XmlAccessorType(AccessType.FIELD)
    @XmlType
    public class SimpleInitiatedConversation {
        @XmlElement
        protected List<String> messages;
        protected String conversationID;
        protected int protocolState;
        public SimpleInitiatedConversation() {
        public List<String> getMessages() {
            if (messages == null) {
                messages = new ArrayList();
            return messages;
        public void setMessages(List<String> messages) {
            this.messages = messages;
        public int getProtocolState() {
            return protocolState;
        public void setProtocolState(int protocolState) {
            this.protocolState = protocolState;
        public String getConversationID() {
            return conversationID;
        public void setConversationID(String conversationID) {
            this.conversationID = conversationID;
    }When I marshalled SimpleNegotiationManager while the HashMap was filled with several <String,SimpleInitiatedConversation> entries, in the output were empty tags initiatedConversations:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <simpleNegotiationManager>
      <initiatedConversations>
      </initiatedConversations>
    </simpleNegotiationManager>When I used schemagen to generate a schema, it produced:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:complexType name="simpleInitiatedConversation">
        <xs:sequence>
          <xs:element name="messages" type="xs:string" maxOccurs="unbounded" minOccurs="0"/>
          <xs:element name="conversationID" type="xs:string" minOccurs="0"/>
          <xs:element name="protocolState" type="xs:int"/>
        </xs:sequence>
      </xs:complexType>
      <xs:element name="simpleNegotiationManager" type="simpleNegotiationManager"/>
      <xs:complexType name="simpleNegotiationManager">
        <xs:sequence>
          <xs:element name="initiatedConversations" type="hashMap" minOccurs="0"/>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="hashMap">
        <xs:complexContent>
          <xs:extension base="abstractMap">
            <xs:sequence/>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:complexType name="abstractMap" abstract="true"/>
    </xs:schema>Particularly the description of HashMap seems ill - there is not specified that the HashMap has keys String and values SimpleInitiatedConversation.
    Unfortunatelly, the j2s-xmlAdapter-field example available with JAXB 2.0 is more complicated than I need. I just need to store/load HashMap into/from XML and I do not care what it looks like. Is it possible to avoid extending XmlJavaTypeAdaptor for a simple storing a HashMap into XML? Perhaps I use improper annotations in the source code, but I cannot get it working. Any clue?

    Ok i figured out one way of doing this by using some classes from JAXP...
    SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Schema s = null;
    try{
        s = sf.newSchema(new File("Sources/schema/test.xsd"));                    
    }catch(Exception e){
        System.err.println("Exception e: " + e.getMessage());
    marshaller.setSchema(s);
    //MyValidationHandler class implements the ValidationEventHandler interface
    MyValidationHandler gv = new MyValidationHandler();
    marshaller.setEventHandler(gv);If anyone has something to add let me know!!

Maybe you are looking for

  • Bug: when fetching arrays of rows with null data values

    Using Oracle ODBC Driver 8.01.73.00 or 8.01.74.00 (called 8.1.7.3.0 and 8.1.7.4.0 on the Oracle downloads page). When fetching multiple rows, and where some of the data is null, the the indicator variable quite often (but not always) has incorrect va

  • Synchronize game center

    Hello, I configured my game center AFTER playing with games during a long while. Now, my "old" games, or my first games, are on game center but without my high scores! Is there a way to sync game center with my "old" games? Thanks

  • Accounts Recievable - Installment Payment Terms

    Hello Experts, This question is regarding installment payment terms. Let's talk about a scenario with installment term with 3 installments... Standard SAP generates 1 invoice with 3 line items The question and the requirement is that we need to gener

  • Solaris 8 Intel would not recognize my HD

    Hi, I have a problem of installing solaris on my Intel box. It used to be fine after i reformat the HD. Then, it never recognized the HD after asking me what language i installed. I try to type the command "Reboot" after it give the unrecongized mess

  • AutonomyPortlets.zip missing in WLP 10.0

    I installed WLP 10.0 using a complete install, but the //WebLogic_Home/cm/thirdparty/autonomy-wlp10/common/AutonomyPortlets.zip file was never installed. Was it accidentally left out of the 10 installer? It is referenced from here: http://edocs.bea.c