5 Replies Latest reply on Sep 17, 2012 5:03 AM by romyo0o

    Problems with missing minOccurs="1" in generated wsdl




      We are using jboss soa platform 4.3.0 CP02 and when I annotate like this:

      @XmlElement(nillable=false, required=true)
          public void setProducer(String producer) {
      public void setProducer(String producer) {   this.producer = producer; }
              this.producer = producer;
      In the generated wsdl (from the deploy), the element producer will look like this:

      <xs:element name="producer" type="xs:string"/>


      Where is the minOccurs="1"???


      If I instead annotate at declaration of producer I get an exception:


          @XmlElement(nillable=false, required=true)   

          private String producer;



      java.lang.IllegalStateException: Cannot build JAXB context


      Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions

      Class has two properties of the same name "producer"

      this problem is related to the following location:

        at public java.lang.String se.tullverket.texi.archive.bl.Trans.getProducer()

        at se.tullverket.texi.archive.bl.Trans

        at public se.tullverket.texi.archive.bl.Trans se.tullverket.texi.archive.bl.ArchiveTO.getTrans()

        at se.tullverket.texi.archive.bl.ArchiveTO

        at private se.tullverket.texi.archive.bl.ArchiveTO se.tullverket.texi.archive.bl.jaxws.Archive.arg0

        at se.tullverket.texi.archive.bl.jaxws.Archive

      this problem is related to the following location:

        at private java.lang.String se.tullverket.texi.archive.bl.Trans.producer


      And if I skip the annotation it looks like this:

      <xs:element minOccurs="0" name="producer" type="xs:string"/>


      Any ideas?