S
Sugandh Jain
I am using a method to serialize objects to xml.
this method is working fine to serialize most of the objects to Xml.
For one collection object, it is not doing so. The Collection and its
containing object are marked [Serilizable].
What could be the reasons for the object not getting serialize, and this is
what i get.
<?xml version="1.0"?>
<ArrayOfAllocatedTrade xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
</ArrayOfAllocatedTrade>
Allocated trade is an object with around 10-12 properties.
This is working fine for all other objects, sample right serialization,
<?xml version="1.0"?>
<CloseTradeInterface xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<BrokenRulesCollection />
<CloseTradeFilter>
<BrokenRulesCollection />
<CloseTradeDate>2006-12-28T14:59:09.2045251+05:30</CloseTradeDate>
<Funds>
<Fund>
<BrokenRulesCollection />
<ID>1</ID>
<ShortName>FundA</ShortName>
<FullName />
</Fund>
</Funds>
<DataSourceNameID>
<BrokenRulesCollection />
<ID>1</ID>
<FullName />
<ShortName />
</DataSourceNameID>
<AUECListValues>
<AUEC>
<BrokenRulesCollection />
<AUECID>1</AUECID>
<AUECName>Equity\US\NASDAQ\USD</AUECName>
</AUEC>
<AUEC>
<BrokenRulesCollection />
<AUECID>11</AUECID>
<AUECName>Equity\US\ARCA\USD</AUECName>
</AUEC>
</AUECListValues>
<DefaultMethodology>0</DefaultMethodology>
<Algorithm>1</Algorithm>
</CloseTradeFilter>
<NetPositions>
<Position>
<BrokenRulesCollection />
<ID>39f10d1f-a6f0-4dcc-9193-d1404a27babd</ID>
<ModifiedAt>2006-12-28T15:01:03.8640112+05:30</ModifiedAt>
<StartDate>2006-12-28T15:01:03.8484049+05:30</StartDate>
<ModifiedBy>0</ModifiedBy>
<Symbol>GOOG</Symbol>
<FundValue>
<BrokenRulesCollection />
<ID>1</ID>
<ShortName />
<FullName>FundA</FullName>
</FundValue>
<AveragePrice>27.4833333333333</AveragePrice>
<PositionType>Long</PositionType>
<AUECID>1</AUECID>
<OpenQty>5500</OpenQty>
<ClosedQty>5000</ClosedQty>
<GeneratedPNL>118149.7618333335</GeneratedPNL>
<PositionTaxLots>
<AllocatedTrade xsi:nil="true" />
</PositionTaxLots>
</Position>
</NetPositions>
</CloseTradeInterface>
this method is working fine to serialize most of the objects to Xml.
For one collection object, it is not doing so. The Collection and its
containing object are marked [Serilizable].
What could be the reasons for the object not getting serialize, and this is
what i get.
<?xml version="1.0"?>
<ArrayOfAllocatedTrade xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
<AllocatedTrade xsi:nil="true" />
</ArrayOfAllocatedTrade>
Allocated trade is an object with around 10-12 properties.
This is working fine for all other objects, sample right serialization,
<?xml version="1.0"?>
<CloseTradeInterface xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<BrokenRulesCollection />
<CloseTradeFilter>
<BrokenRulesCollection />
<CloseTradeDate>2006-12-28T14:59:09.2045251+05:30</CloseTradeDate>
<Funds>
<Fund>
<BrokenRulesCollection />
<ID>1</ID>
<ShortName>FundA</ShortName>
<FullName />
</Fund>
</Funds>
<DataSourceNameID>
<BrokenRulesCollection />
<ID>1</ID>
<FullName />
<ShortName />
</DataSourceNameID>
<AUECListValues>
<AUEC>
<BrokenRulesCollection />
<AUECID>1</AUECID>
<AUECName>Equity\US\NASDAQ\USD</AUECName>
</AUEC>
<AUEC>
<BrokenRulesCollection />
<AUECID>11</AUECID>
<AUECName>Equity\US\ARCA\USD</AUECName>
</AUEC>
</AUECListValues>
<DefaultMethodology>0</DefaultMethodology>
<Algorithm>1</Algorithm>
</CloseTradeFilter>
<NetPositions>
<Position>
<BrokenRulesCollection />
<ID>39f10d1f-a6f0-4dcc-9193-d1404a27babd</ID>
<ModifiedAt>2006-12-28T15:01:03.8640112+05:30</ModifiedAt>
<StartDate>2006-12-28T15:01:03.8484049+05:30</StartDate>
<ModifiedBy>0</ModifiedBy>
<Symbol>GOOG</Symbol>
<FundValue>
<BrokenRulesCollection />
<ID>1</ID>
<ShortName />
<FullName>FundA</FullName>
</FundValue>
<AveragePrice>27.4833333333333</AveragePrice>
<PositionType>Long</PositionType>
<AUECID>1</AUECID>
<OpenQty>5500</OpenQty>
<ClosedQty>5000</ClosedQty>
<GeneratedPNL>118149.7618333335</GeneratedPNL>
<PositionTaxLots>
<AllocatedTrade xsi:nil="true" />
</PositionTaxLots>
</Position>
</NetPositions>
</CloseTradeInterface>