> -----Original Message----- > From: KARR, DAVID (ATTCINW) > Sent: Monday, July 13, 2009 3:51 PM > To: axis-user@ws.apache.org > Subject: Axis skips generating type if it thinks it can just make an > array > > I'm using Axis 1.3. I have a schema with a complexType which has a > single sequence of one element (unbounded count on that one element). > It looks something like this (the commented element will come up > later): > > <xs:complexType name="SomethingItemPropertyListInfo"> > <xs:sequence> > <xs:element name="PropertyData" > type="SomethingPropertyInfo" minOccurs="0" maxOccurs="unbounded"/> > <!--<xs:element name="Dummy" type="xs:boolean" > minOccurs="0"/> --> > </xs:sequence> > </xs:complexType> > > When we generate code from this schema, the generated class > corresponding to this type is, well, nonexistent. It generates nothing > for it. > > If we instead comment in the "Dummy" element, it generates the > "SomethingItemPropertyListInfo" class. This is a workaround, but an > annoying one. We'd really like to have the schema definition not > include "Dummy", but still generate the "SomethingItemPropertyListInfo" > type. > > At this point, we haven't attempted to inject Castor or XMLBeans into > the picture to customize our code generation. We would definitely > consider that if that's the only viable way to resolve this issue.
If it helps, I've been setting up a little testbed to give me more diagnostics for this problem. I tried adding the "-D" (debug) flag to the command line, and I've compared the output when I have "Dummy" and when I don't. When I have Dummy, I see this (relevant excerpts): --------------------- org.apache.axis.wsdl.symbolTable.DefinedType QName: {http://csi.cingular.com/CSI/Namespaces/Types/Public/CingularDataModel.x sd}SomethingItemPropertyListInfo name: com.cingular.csi.CSI.Namespaces.Types.Public.CingularDataModel_xsd.Somet hingItemPropertyListInfo isReferenced? true Class: org.apache.axis.wsdl.symbolTable.DefinedType Base?: false Undefined?: false isSimpleType? false Node: [xs:complexType: null] Dims: isOnlyLiteralReferenced: false RefType: null org.apache.axis.wsdl.symbolTable.CollectionType QName: {http://csi.cingular.com/CSI/Namespaces/Types/Public/CingularDataModel.x sd}SomethingItemPropertyListInfo[0,unbounded] name: com.cingular.csi.CSI.Namespaces.Types.Public.CingularDataModel_xsd.Somet hingItemPropertyListInfo[] isReferenced? true Class: org.apache.axis.wsdl.symbolTable.CollectionType Base?: false Undefined?: false isSimpleType? false Node: [xs:element: null] Dims: [] isOnlyLiteralReferenced: false RefType: QName: {http://csi.cingular.com/CSI/Namespaces/Types/Public/CingularDataModel.x sd}SomethingItemPropertyListInfo name: com.cingular.csi.CSI.Namespaces.Types.Public.CingularDataModel_xsd.Somet hingItemPropertyListInfo isReferenced? true Class: org.apache.axis.wsdl.symbolTable.DefinedType Base?: false Undefined?: false isSimpleType? false Node: [xs:complexType: null] Dims: isOnlyLiteralReferenced: false RefType: null Generating gen\com\cingular\csi\CSI\Namespaces\Types\Public\CingularDataModel_xsd\S omethingItemPropertyListInfo.java --------------------- When I don't have Dummy, I see this: --------------------- org.apache.axis.wsdl.symbolTable.DefinedType QName: {http://csi.cingular.com/CSI/Namespaces/Types/Public/CingularDataModel.x sd}SomethingItemPropertyListInfo name: com.cingular.csi.CSI.Namespaces.Types.Public.CingularDataModel_xsd.Somet hingPropertyInfo[] isReferenced? true Class: org.apache.axis.wsdl.symbolTable.DefinedType Base?: false Undefined?: false isSimpleType? false Node: [xs:complexType: null] Dims: [] isOnlyLiteralReferenced: false RefType: QName: {http://csi.cingular.com/CSI/Namespaces/Types/Public/CingularDataModel.x sd}SomethingPropertyInfo name: com.cingular.csi.CSI.Namespaces.Types.Public.CingularDataModel_xsd.Somet hingPropertyInfo isReferenced? true Class: org.apache.axis.wsdl.symbolTable.DefinedType Base?: false Undefined?: false isSimpleType? false Node: [xs:complexType: null] Dims: isOnlyLiteralReferenced: false RefType: null org.apache.axis.wsdl.symbolTable.CollectionType QName: {http://csi.cingular.com/CSI/Namespaces/Types/Public/CingularDataModel.x sd}SomethingItemPropertyListInfo[0,unbounded] name: com.cingular.csi.CSI.Namespaces.Types.Public.CingularDataModel_xsd.Somet hingPropertyInfo[][] isReferenced? true Class: org.apache.axis.wsdl.symbolTable.CollectionType Base?: false Undefined?: false isSimpleType? false Node: [xs:element: null] Dims: [] isOnlyLiteralReferenced: false RefType: QName: {http://csi.cingular.com/CSI/Namespaces/Types/Public/CingularDataModel.x sd}SomethingItemPropertyListInfo name: com.cingular.csi.CSI.Namespaces.Types.Public.CingularDataModel_xsd.Somet hingPropertyInfo[] isReferenced? true Class: org.apache.axis.wsdl.symbolTable.DefinedType Base?: false Undefined?: false isSimpleType? false Node: [xs:complexType: null] Dims: [] isOnlyLiteralReferenced: false RefType: QName: {http://csi.cingular.com/CSI/Namespaces/Types/Public/CingularDataModel.x sd}SomethingPropertyInfo name: com.cingular.csi.CSI.Namespaces.Types.Public.CingularDataModel_xsd.Somet hingPropertyInfo isReferenced? true Class: org.apache.axis.wsdl.symbolTable.DefinedType Base?: false Undefined?: false isSimpleType? false Node: [xs:complexType: null] Dims: isOnlyLiteralReferenced: false RefType: null --------------------- If you examine the differences, it's clear that without "Dummy", it doesn't generate SomethingItemPropertyListInfo, assuming that "SomethingPropertyInfo[]" will be used in its place. With this additional information (which mostly just confirms what I thought was happening), is there a straightforward way to get around this? If I move to generating code with Castor, will I be able to solve this problem, hopefully without creating more problems?