Sorry...I figured it out with the abstract="true".

Not sure if I can piggy back of this question though.

Below I have a TxnInfo segment that I do not represent in my object model.  Is there a way I can ignore this element in the marshal/unmarshal?

Because I get a org.jibx.runtime.JiBXException: No unmarshaller for element "TxnInfo" (line 3, col 11) since I have not defined a mapping for it.

Thanks,

-jay


On 4/13/06, Jay Blanton <[EMAIL PROTECTED]> wrote:
If I have portions of my object model that do not exist in the incoming XML, how do I bypass placing a name attribute on the mapping definition.

For instance, I have the following XML chunk:

<AppBody>
    <TxnInfo>
        <SystemId>WebService</SystemId>
    </TxnInfo>
    <Sponsor>
        <Id>0013</Id>
    </Sponsor>
    <Person>
        <Id>123</Id>
    </Person>
</AppBody>

The AppBody is the beginning of my ResponseTO which contains an ErrorInfo object (if the xml exists) and a list (custom collection) of FamilyTOs.  The FamilyTO contains an object called SponsorTO and PersonTO.  So as you can see, there is no Family element in the XML...it is just a composite object that holds the SponsorTO and PersonTO.  How do I define my mapping segment below so that I can use the FamilyTO mapping without having to include an element name?

    <mapping name="AppBody" class="com.foo.to.ResponseTO">
        <collection field="families" load-method="get" size-method="size" add-method="add" item-type=" com.foo.to.FamilyTO" usage="optional"/>
        <structure field="errorInfo" usage="optional"/>        
    </mapping>
    <mapping name="ErrorInfo" class=" com.foo.to.ErrorInfoTO">
        <value name="ErrorType" field="errorType" usage="optional"/>
        <value name="ErrorMsgUser" field="userMessage" usage="optional"/>
        <value name="ErrorMsgTechnical" field="technicalMessage" usage="optional"/>
        <value name="ErrorCode" field="errorCode" usage="optional"/>
    </mapping>
    <mapping class="com.foo.to.FamilyTO">
        <structure field="sponsor" usage="optional"/>
        <collection field="patients" load-method="get" size-method="size" add-method="add" item-type=" com.foo.to.PatientTO" usage="optional"/>
        <structure field="sponsor" usage="optional"/>
    </mapping>

Thanks!

--
jay blanton
[EMAIL PROTECTED]



--
jay blanton
[EMAIL PROTECTED]
(c) 916-715-1529

Reply via email to