Hi,

We have a very simple setup requiring that unbounded sequences be marshaled.
The process we manage is as follows:

An external entity submits a file containing one or more transactions to us
for processing.  The un-marshalling side of the code generated by Castor
works great except for not reporting some of the XML field names that fails
validation.  That besides, we process the requests for the submitted files.
One of the possible returns that we would like to send back to the
requesting party is based on the following schema:

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XML Spy v3.5 (http://www.xmlspy.com) by  () -->
<xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema";
elementFormDefault="qualified">
        <xsd:include
schemaLocation="\\webdev\javasrc\xsd\StdRespHeader.xsd"/>
        <xsd:element name="GenericResp">
                <xsd:annotation>
                        <xsd:documentation>Generic response to
transactions</xsd:documentation>
                </xsd:annotation>
                <xsd:complexType>
                        <xsd:sequence>
                                <xsd:element ref="StdRespHeader"/>
                                <xsd:element name="TxState">
                                        <xsd:simpleType>
                                                <xsd:restriction
base="xsd:string">
                                                        <xsd:enumeration
value="INTERNAL_ERROR"/>
                                                        <xsd:enumeration
value="SUCCESS"/>
                                                        <xsd:enumeration
value="XML_INVALID"/>
                                                        <xsd:enumeration
value="FIELD_INVALID"/>
                                                        <xsd:enumeration
value="TXAN_NOT_AUTHORISED"/>
                                                        <xsd:enumeration
value="MAX_SESSIONS_IN_USE"/>
                                                        <xsd:enumeration
value="NOT_LOGGED_IN"/>
                                                        <xsd:enumeration
value="USER_AUTHENTICATION_ERROR"/>
                                                </xsd:restriction>
                                        </xsd:simpleType>
                                </xsd:element>
                                <xsd:sequence minOccurs="0"
maxOccurs="unbounded">
                                        <xsd:element name="ErrField"
type="xsd:string"/>
                                        <xsd:element name="ErrDesc">
                                                <xsd:simpleType>
                                                        <xsd:restriction
base="xsd:string">
        
<xsd:whiteSpace value="collapse"/>
                                                        </xsd:restriction>
                                                </xsd:simpleType>
                                        </xsd:element>
                                </xsd:sequence>
                        </xsd:sequence>
                </xsd:complexType>
        </xsd:element>
</xsd:schema>

What is boils down to is that we send a basic response header, a transaction
state and then depending on if there were errors - be it XML format or
business rule errors, a sequence of

sequence:
{
        Error Field Name
        Error Description / Code
}

i.e. the                <xsd:sequence minOccurs="0" maxOccurs="unbounded">
                                        <xsd:element name="ErrField"
type="xsd:string"/>
                                        <xsd:element name="ErrDesc">
                                                <xsd:simpleType>
                                                        <xsd:restriction
base="xsd:string">
        
<xsd:whiteSpace value="collapse"/>
                                                        </xsd:restriction>
                                                </xsd:simpleType>
                                        </xsd:element>
                                </xsd:sequence>
part.

The source code generated by Castor (latest version from the CVS system),
generates a class that contains a set / get method for the last sequence's
fields - no problem.  What we would like to know is how to use the set
methods combined with the marshal method so that we may Marshall multiple
error descriptions entries without ending up with a file containing a 

<?xml version="1.0" encoding="UTF-8"?> 

preceding each and every sequence pair on the output writer side ?   

Is there some setting available that will allow the code generator to
generate a vector or list class that will hold multiple entries for each of
the sequence fields so that we may call the marshal method only once ?.

Any help will be appreciated

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to