Hi Mailinglist,

we are develope an WEB-Service with Apache CXF working with JXB Databinding. Wo work on Contract-First.

In our wsdl is an Object defined with Attributes like (striped):

--- cut ---
   <xsd:complexType name="Pruefanweisung">
       <xsd:sequence>
           <xsd:element name="pruefrhythmusPruefer" type="xsd:string"
               nillable="false" minOccurs="1" maxOccurs="1" />
[...]
       </xsd:sequence>
   </xsd:complexType>
--- cut ---

the generated Java-Class (striped):

--- cut ---
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Pruefanweisung", propOrder = {
   "pruefrhythmusPruefer",
[...]
})
public class Pruefanweisung {
   @XmlElement(required = true)
   protected String pruefrhythmusPruefer;
   /**
    * Gets the value of the pruefrhythmusPruefer property.
    *
    * @return
    *     possible object is
    *     {...@link String }
* */
   public String getPruefrhythmusPruefer() {
       return pruefrhythmusPruefer;
   }
   /**
    * Sets the value of the pruefrhythmusPruefer property.
    *
    * @param value
    *     allowed object is
    *     {...@link String }
* */
   public void setPruefrhythmusPruefer(String value) {
       this.pruefrhythmusPruefer = value;
   }
[...]
}
--- cut ---

The Attribute "pruefruethmusPruefer" is an Attribute of Pruefanweisung.
Now the Customer of the Service is sending something like:

--- cut ---
    <pruefrhythmusPruefer>XXXX Sport</pruefrhythmusPruefer>
    <pruefrhythmusPruefer>Hersteller</pruefrhythmusPruefer>
--- cut ---

Here the Attribute pruefrythmus comes more than once. In my resulting Java-Class i can found the last occurance of the Attribute.

A second example of an Object:

--- cut ---
<projekte>
   <kennzeichen>X70</kennzeichen>
   <bezeichnung>
     <sprachkennzeichen>de_DE</sprachkennzeichen>
     <text>R10+(R10)</text>
   </bezeichnung>
   <kennzeichen>X99</kennzeichen>
   <bezeichnung>
     <sprachkennzeichen>de_DE</sprachkennzeichen>
     <text>R10 Bst. 2</text>
   </bezeichnung>
  </projekte>
--- cut ---

Here an colosing and starting "projekte"-Element is missing, but the Parser results my one Object of "projekte" containig the last Elements.

Is it Possible that the XML-Parser throws Exceptions if the sendt XML is bad?

Thanks a lot.

Robert


Reply via email to