Axel-
 
what happens if you set the minOccurs and maxOccurs attributes e.g.
elemfield.setMinOccurs(SomeLowNumberLessThanHigherNumber);
elemfield.setMaxOccurs(SomeHigherThanLowNumber);
 
M-
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
contents
----- 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:sequence>
   <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" />
  </xs:sequence>
 </xs:complexType>
Now when I generate Axis stubs with this definition I will get the following code in Professional.java:
 
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://bpm.icw.com/regservices/v1-0-0/domain ", "Professional"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName ("organizationName");
        elemField.setXmlName(new javax.xml.namespace.QName("
http://bpm.icw.com/regservices/v1-0-0/domain ", "organizationName"));
        elemField.setXmlType(new javax.xml.namespace.QName("
http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        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,
Axel.
 
 
 
 
 
 

Reply via email to