axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <>
Subject Re: [Axis1.4] MinOccurs is ignored with string types?
Date Tue, 24 Oct 2006 14:42:24 GMT

what happens if you set the minOccurs and maxOccurs attributes e.g.

This e-mail communication and any attachments may contain confidential and privileged information
for the use of the 
designated recipients named above. If you are not the intended recipient, you are hereby notified
that you have received
this communication in error and that any review, disclosure, dissemination, distribution or
copying of it or its 
  ----- Original Message ----- 
  From: Axel Bock 
  Sent: Tuesday, October 24, 2006 10:25 AM
  Subject: [Axis1.4] MinOccurs is ignored with string types?

  Hi all, 

  I have a WSDL file with a schema definition like this: 
     <xs:complexType name="Professional">
       <xs:element name="name" type="Name" />
       <xs:element name="contact" type="ContactData" minOccurs="0" /> 
       <xs:element name="qualification" type="Qualification" />
       <xs:element name="additionalQualification" type="Qualification" minOccurs="0" />
       <xs:element name="organizationName" type="xs:string" minOccurs="0" /> 
  Now when I generate Axis stubs with this definition I will get the following code in

          typeDesc.setXmlType(new javax.xml.namespace.QName("
", "Professional"));
          org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
          elemField.setFieldName ("organizationName");
          elemField.setXmlName(new javax.xml.namespace.QName("
", "organizationName"));
          elemField.setXmlType(new javax.xml.namespace.QName("",
          elemField = new org.apache.axis.description.ElementDesc();
          // ... 
  As you can see the MinOccurs command is completely ignored on the organization element.
On the other optional complex types this is not a problem, though. I adjusted the MinOccurs
to 5 and the MaxOccurs to 7, and even then no (min/max)Occurs property setting was present
in the generated code. 

  So now I think that maybe Axis has a problem with simple types like String when it comes
to generate code with occurrency information. Can anyone confirm this, maybe? Or tell me what
I'm doing wrong? Or - best of all :-) - give me a workaround? 

  Greetings & thanks in advance, 

View raw message