Hi,

Anybody has any comments or suggestions? I would appreciate any suggestions or help.

I am currently working on a bridge linking a GUI working on XML over CORBA with pure 
CORBA servers. CASTOR is used to convert XMLs to Java CORBA Stub classes.

I really like CASTOR as a tool, this is probably the only roadblock that is left at 
the moment.

Thanks

Michal

> -----Original Message-----
> From: Grzemowski, Michal 
> Sent: Tuesday, June 01, 2004 3:48 AM
> To: [EMAIL PROTECTED]
> Cc: Wyrzycki, Pawel
> Subject: [castor-user] Problems with container attribute when 
> collection="array"
> 
> Hi,
> 
> I am experiencing strange behavior of the container attribute 
> (yes, I have read the FAQ ;-), when the field is a 
> collection="array". Can you please suggest a solution?
> 
> I understand from the FAQ, that if I don't specify the 
> "container" attribute, then:
> 1. The collection field will be treated like a container (not 
> marshaled into XML) AND
> 2. The collection elements will not be treated like 
> containers (will be marshaled).
> 
> My field which is a collection="array" is marshaled into XML 
> even when I don't specify the container attribute.
> 
> Can you please help out?
> 
> Gory details follow (the problem is the "value" tag which 
> according to my understanding of documentation shouldn't be there:
> 
> Mapping:
> <?xml version="1.0" encoding="UTF-8"?>
> <mapping>
>     <class name="PRMSG.PricingMessage" auto-complete="false">
>         <description>Default mapping for class 
> PRMSG.PricingMessage</description>
>         <map-to xml="outputMessage"/>
>       (...) here go the following fields: msgType, msgNumber, 
> msgText, msgAirlineCode
>     </class>
>     <class name="PRMSG.PricingMessageSeqHolder" auto-complete="true">
>         <description>Default mapping for class 
> PRMSG.PricingMessageSeqHolder</description>
>         <map-to xml="PricingMessageSeqHolder"/>
>         <field        name="value" 
>                       type="PRMSG.PricingMessage" 
>                       direct="true" 
>                       collection="array">
>               <bind-xml name="value"/>
>         </field>
>     </class>    
> </mapping>
> 
> The classes look like this:
> 
> public final class PricingMessageSeqHolder implements 
> org.omg.CORBA.portable.Streamable
> {
>   public PRMSG.PricingMessage value[] = null;
> (...)
> }
> 
> public final class PricingMessage implements 
> org.omg.CORBA.portable.IDLEntity
> {
>   public char msgType = (char)0;
>   public short msgNumber = (short)0;
>   public char msgAirlineCode[] = null;
>   public String msgText = null;
> } 
> 
> CASTOR generates the following XML:
> <?xml version="1.0" encoding="UTF-8"?>
> <PricingMessageSeqHolder>
>       <value>
>               <msgType>A</msgType>
>               <msgNumber>12</msgNumber>
>               <msgText>msgText content</msgText>
>               <msg-airline-code> KRK</msg-airline-code>
>       </value>
>       <value>
>               <msgType>B</msgType>
>               <msgNumber>23</msgNumber>
>               <msgText>msgText content1</msgText>
>               <msg-airline-code> LHW</msg-airline-code>
>       </value>
> </PricingMessageSeqHolder>
> 
> Thanks,
> 
> Michal
> 
> 

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

Reply via email to