Hello all,
I'm having some problems with the castor binding file. I'm using some
standard schemas produced from ECMA, so I really don't want to modify
the schemas if I can help it. The problem that I'm having is that there
are several schemas that have the same name for a complex type:
definedError. Two example schemas are below:
<xsd:element name="StartApplicationSessionNegResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="errorCode">
<xsd:complexType>
<xsd:choice>
<xsd:element name="definedError">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="invalidApplicationInfo"/>
<xsd:enumeration
value="requestedProtocolVersionNotSupported"/>
<xsd:enumeration value="serverResourcesBusy"/>
<xsd:enumeration value="maxNumberSessions"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="applError" type="xsd:string"/>
</xsd:choice>
</xsd:complexType>
</xsd:element>
<xsd:element name="extensions" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:any namespace="##any" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="StopApplicationSessionNegResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="errorCode">
<xsd:complexType>
<xsd:choice>
<xsd:element name="definedError">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="invalidSessionID"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="applError" type="xsd:string"/>
</xsd:choice>
</xsd:complexType>
</xsd:element>
<xsd:element name="extensions" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:any namespace="##any" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
When I use castor to generate classes without using the binding file, I
end up with only one DefinedError type: the one overwrites the other. I
tried using the binding file to resolve this naming conflict, but it
doesn't appear to be working. Here's what my binding file looks like:
<binding defaultBindingType="type">
<elementBinding
name="complexType:StartApplicationSessionNegResponse/errorCode/definedEr
ror">
<java-class name="StartSessionDefinedError">
</java-class>
</elementBinding>
<elementBinding
name="complexType:StopApplicationSessionNegResponse/errorCode/definedErr
or">
<java-class name="StopSessionDefinedError">
</java-class>
</elementBinding>
</binding>
I'm trying to create StartSessionDefinedError and a StopSessionDefined
error, but when I generate code with this binding file, I get exactly
the same behavior as before. I know that it's looking at my binding
file because if I introduce a syntax error I get an compile error. Does
anybody have any idea what's wrong with my binding file?
Thanks,
Joel
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user