Hi

This is my first stab at using Castor...It has been good learning curve so
far. I am presently stuck with something and would need your help in
resolving it.

The output xml that I am looking for should be as below

<retrieve-caller-summary-service-response>
            <consumer-wrapper>
                  <customer/>
            </consumer-wrapper>

            <consumer-wrapper>
                  <customer/>
            </consumer-wrapper>

</retrieve-caller-summary-service-response>



My mapping looks as below

        <class name="RetrieveCallerSummaryServiceResponse" auto-complete=
"true">
            <map-to xml="retrieve-caller-summary-service-response"/>
            <field name="consumers" type="Consumer" collection="array">
                  <bind-xml auto-naming="deriveByClass" location=
"consumer-wrapper" node="element"/>
            </field>
        </class>


Consumer is an abstract class. Customer and FormerCustomer are concrete
classes that extend Consumer class.

The WSDL definition for Consumer-wrapper is

     <xs:element name="consumerWrapper">
          <xs:complexType>
            <xs:choice>
               <xs:element name="customer" type="Customer"/>
               <xs:element name="formerCustomer" type="FormerCustomer"/>
            </xs:choice>
          </xs:complexType>
       </xs:element>

So, the consumerwrapper can have either customer or formercustomers or both


But the problem that I am facing are of 2 kinds


1. When 2 customers are a part of the ConsumerWrapper, it fails with
org.exolab.castor.xml.MarshalException: element "customer" occurs more than
once.
2. If there is customer and former customer, the output is as below which
is different from what I expect.

<retrieve-caller-summary-service-response>
            <consumer-wrapper>
                  <customer/>
                  <formercustomer/>
            </consumer-wrapper>
</retrieve-caller-summary-service-response>


Any help would be appreciated.

thanks

Kind Regards
Sarathi Balasundaram
This email is confidential and should not be used by anyone who is not
the original intended recipient. Prudential cannot accept liability
for statements made which are clearly the sender's own and not made
on behalf of the Prudential. In addition, no statement should be
construed as giving investment advice within or outside the United
Kingdom

Prudential plc, incorporated and registered in England and Wales.
Registered Office at Laurence Pountney Hill, London, EC4R 0HH.
Registered number 1397169. Prudential plc is a holding company,
subsidiaries of which are authorised and regulated by the Financial
Services Authority (FSA)

'Prudential' is a trading name of The Prudential Assurance Company
Limited, which is incorporated and registered in England and Wales.
Registered Office at Laurence Pountney Hill, London, EC4R 0HH.
Registered number 15454. Authorised and regulated by the Financial
Services Authority. 'Prudential' is also used by other companies within
the Prudential Group, which between them provide a range of financial
products including life assurance, pensions, savings and investment
products

'Prudential' is also a trading name of Prudential Distribution Limited, 
which is incorporated and registered in Scotland.  Registered Office at 
Craigforth, Stirling, FK9 4UE.  Registered number SC212640. Authorised 
and regulated by the Financial Services Authority.

A list of other Prudential companies together with their registered
statutory details can be found in 'About Prudential' on 
http://www.prudential.co.uk

An email reply to this address may be subject to interception or
monitoring for operational reasons or for lawful business practices.

Reply via email to