Hi
I am using fpml version 4.3 schema and it has a base class reference Product in
it like this: <xsd:element ref="product" />
Product is actually a base class and it is generated properly using Castor
source code generation. The derived class could be swap, fra....., I checked
the classes and descriptors and the classes look correct. However, when I give
it an xml file, the validation fails and says
org.exolab.castor.xml.MarshalException: The following exception occured while
validating field: _trade of class: com.calypso.casto
r.SD.fpml43.RequestTradeConfirmation: The field '_product' (whose xml name is
'product') is a required field of class 'com.
.castor.SD.fpml43.Trade{File: [not available]; line: 112; column: 8}
It looks like the code is correct but the validation does not know how to
interpret product and treat <product> as a real tag rather than a base class
which can have subclass values during run time.
Any idea how I can solve this problem ? I turned off the validation but product
will be null.
Schema below********************************************
<xsd:complexType name="Trade">
<xsd:annotation>
<xsd:documentation xml:lang="en">A type defining an FpML
trade.</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="tradeHeader" type="TradeHeader">
<xsd:annotation>
<xsd:documentation xml:lang="en">The information on the trade which
is not product specific, e.g. trade date.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element ref="product" />
<xsd:element name="otherPartyPayment" type="Payment" minOccurs="0"
maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation xml:lang="en">Other fees or additional payments
associated with the trade, e.g. broker commissions, where one or more of the
parties involved are not principal parties involved in the
trade.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="brokerPartyReference" type="PartyReference"
minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation xml:lang="en">Identifies that party (or parties)
that brokered this trade.</xsd:documentation>
</xsd:annotation>
</xsd:element>