[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    [jira] Created: (XMLBEANS-273) Attributes not populated when
From:       "Gero Vermaas (JIRA)" <xmlbeans-dev () xml ! apache ! org>
Date:       2006-05-29 13:47:36
Message-ID: 4362259.1148910456683.JavaMail.jira () brutus
[Download RAW message or body]

Attributes not populated when deserializing XML
-----------------------------------------------

         Key: XMLBEANS-273
         URL: http://issues.apache.org/jira/browse/XMLBEANS-273
     Project: XMLBeans
        Type: Bug

  Components: Binding  
    Versions: Version 2.1    
 Environment: JDK 1.4.2, Ubuntu 5.10
    Reporter: Gero Vermaas


I'm attempting to deserialize the following XML. It all seems to work OK, but the \
attributes of the resulting XmlObject subclass are not populated. I isolated the case \
                into a unit test.Below are the:
- XML Message being parsed
- The code used to parse it
- Parts of the XSDs

A clue might be the fact that this is the first time I'm deserializing something that \
has a "choice" element....

=== XML Message being parsed ===
<makeOrderValueException
  xmlns="http://java.sun.com/products/oss/xml/ServiceActivation"
  xmlns:co="http://java.sun.com/products/oss/xml/Common"
  xmlns:ri="http://www.ossj.org/RiServiceActivation"
  xmlns:sa="http://java.sun.com/products/oss/xml/ServiceActivation"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \
xsi:schemaLocation="http://www.ossj.org/ServiceActivation">  \
<co:IllegalArgumentException>  <message>javax.oss.IllegalArgumentException: Order \
                type non.existing.OrderValue ist not supported
      javax.oss.IllegalArgumentException: Order type non.existing.OrderValue ist not \
supported  </message>
  </co:IllegalArgumentException>
</makeOrderValueException>

===     The unit test code   ===

    ClassPathResource res = new ClassPathResource("illegalAttributeException.xml");
        
    MakeOrderValueExceptionDocument exDoc = \
MakeOrderValueExceptionDocument.Factory.parse(res.getInputStream());  \
MakeOrderValueException move = exDoc.getMakeOrderValueException();

    log.debug("testIllegalAttributeException() exDoc: " + move.xmlText());   // <- \
Shows correct XML

    assertTrue(move.isSetIllegalArgumentException());  // <-- FAILS
    assertNotNull(move.getIllegalArgumentException()); // <-- FAILS

=== XSD parts from "co" schema (http://java.sun.com/products/oss/xml/Common)  ===

<complexType name="BaseException" abstract="true">
    <annotation>
      <documentation>a</documentation>
    </annotation>
    <sequence>
      <element name="message" type="string">
        <annotation>
          <documentation>The Message element indicates the error message from the \
                Exception. This is most 
          likely the results from a Exception.getMessage() call.</documentation>
        </annotation>
      </element>
    </sequence>
  </complexType>

  <complexType name="IllegalArgumentException">
    <annotation>
      <documentation>The IllegalArgumentException  exception is
      returned by the OSS through Java XML/JMS interface to report
      that the request could not be completed because one of the
      arguments passed in is invalid.</documentation>
    </annotation>
    <complexContent>
      <extension base="co:BaseException">
        <sequence/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="RemoteException">
    <annotation>
      <documentation> The RemoteException is returned when an
      errors occurs during any remote object
      operation.</documentation>
    </annotation>
    <complexContent>
      <extension base="co:BaseException">
        <sequence/>
      </extension>
    </complexContent>
  </complexType>

====  XSD parts from default schema \
(http://java.sun.com/products/oss/xml/ServiceActivation) ====

  <element name="makeOrderValueException">
    <annotation>
      <documentation>This is returned if an exception
      occurrs.</documentation>
    </annotation>
    <complexType>
      <choice>
        <element name="illegalArgumentException" type="co:IllegalArgumentException"/>
        <element name="remoteException" type="co:RemoteException"/>
      </choice>
    </complexType>
  </element>

==================

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic