Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-1032

Invalid schema element order with JSR181 complex types

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • None
    • tools-jaxrpc
    • None

      tdiesler@TDDELL /cygdrive/d/svn/jbossws/trunk/src/test
      $ ant -Dtest=org.jboss.test.ws.jsr181.webresult.JSR181WebResultTestCase one-test

      one-test:
      [junit] Running org.jboss.test.ws.jsr181.webresult.JSR181WebResultTestCase
      [junit] Tests run: 2, Failures: 0, Errors: 1, Time elapsed: 2.844 sec
      [junit] Test org.jboss.test.ws.jsr181.webresult.JSR181WebResultTestCase FAILED

      @XmlAccessorType(XmlAccessType.FIELD)
      @XmlType(name = "CustomerRecordType", propOrder =

      { "firstName", "lastName", "address" }

      )
      public class CustomerRecord
      {
      @XmlElement(name="FirstName", required = true)
      private String firstName;
      @XmlElement(name="LastName", required = true)
      private String lastName;
      @XmlElement(name="Address", required = true)
      private USAddress address;

      <schema elementFormDefault='qualified' targetNamespace='http://webresult.jsr181.ws.test.jboss.org/jaws' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://webresult.jsr181.ws.test.jboss.org/jaws' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
      <complexType name='CustomerRecord'>
      <sequence>
      <element name='address' nillable='true' type='tns:USAddress'/>
      <element name='firstName' nillable='true' type='string'/>
      <element name='lastName' nillable='true' type='string'/>
      </sequence>
      </complexType>
      <complexType name='USAddress'>
      <sequence>
      <element name='address' nillable='true' type='string'/>
      </sequence>
      </complexType>
      </schema>

      Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Requested element FirstName is not allowed in this position in the sequence. The next element should be

      {http://webresult.jsr181.ws.test.jboss.org/jaws}

      address
      at org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding$1.startElement(SequenceBinding.java:214)
      at org.jboss.xb.binding.sunday.unmarshalling.ModelGroupBinding$Cursor.startElement(ModelGroupBinding.java:151)
      at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:192)
      at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:299)

              jgreene@redhat.com Jason Greene
              tdiesler@redhat.com Thomas Diesler
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: