Hi,

I haven't check this, but I think the only missing point here is the name 
attribute
of the collection. Additionally, I think the item-type definition is not 
correct.
You have to define the following:

   <?xml version="1.0" encoding="UTF-8"?>
   <binding force-classes="true" 
            xmlns:tns="http://...peering.service"; 
            value-style="element">
       <namespace uri="http://...peering.service"; default="elements"/>

       <mapping abstract="true" 
                type-name="tns:AContainee" 
                class="AContainee" ordered="false">
           <value name="id" field="id" usage="optional"/>
           <value name="aContainer" field="aContainer" usage="optional"/>
       </mapping>

       <mapping abstract="true" 
                type-name="tns:AContainer" 
                class="AContainer" ordered="false">
           <value name="name" field="name" usage="optional"/>
           <collection name="AContainees" field="aContainees" 
item-type="AContainee"/>
       </mapping>
   </binding>

I hope it helps!

Mit freundlichen Grüßen

Frank Häfemeier
Senior IT-Consultant

LogicaCMG GmbH & Co KG

Main Airport Center (MAC)
Unterschweinstiege 10, 60549 Frankfurt
Tel: +49-69-26499-0
mailto:[EMAIL PROTECTED]

Am Sandtorkai 72, 20457 Hamburg
Handelsregister AG Hamburg HRA 96547
persönlich haftender Gesellschafter:
LogicaCMG Verwaltungs GmbH
Handelsregister AG Hamburg HRB 82051
Geschäftsführer: Torsten Strass (Vors.) / Serge Dubrana / Thomas Elsner / 
Andreas Manganaro
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Max Spring
Sent: Mittwoch, 13. Juni 2007 20:29
To: jibx-users@lists.sourceforge.net
Subject: [jibx-users] Binding for Typed Arrays

Is it possible to have a collection mapped to a typed array?  I could not find 
an example, nor do my attempts work.

Details: I have XML messages like this one:

   <?xml version='1.0' encoding='UTF-8'?>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
     <soapenv:Body>
       <ns:getContainersResponse xmlns:ns="http://...peering.service";>
         <ns:getContainersReturn>
           <ns:AContainees>
             <ns:aContainee>
               <ns:id>4711</ns:id>
             </ns:aContainee>
             <ns:aContainee>
               <ns:id>4712</ns:id>
             </ns:aContainee>
             <ns:aContainee>
               <ns:id>4713</ns:id>
             </ns:aContainee>
             <ns:aContainee>
               <ns:id>4714</ns:id>
             </ns:aContainee>
             <ns:aContainee>
               <ns:id>4715</ns:id>
             </ns:aContainee>
           </ns:AContainees>
           <ns:name>name-of-container</ns:name>
         </ns:getContainersReturn>
       </ns:getContainersResponse>
     </soapenv:Body>
   </soapenv:Envelope>

And POJOs structured like that:

   public class AContainer{
       ...
       private String name;
       public String getName(){...}
       public void setName(String name){...}

       private AContainee[] aContainees;
       public AContainee[] getAContainees(){...}
       public void setAContainees(AContainee[] aContainees){...}
   }

   public class AContainee{
       ...
       private int id;
       public int getId(){...}
       public void setId(int id){...}

       private AContainer aContainer;
       public AContainer getAContainer(){...}
       public void setAContainer(AContainer aContainer){...}
   }

I'm trying this binding.xml:

   <?xml version="1.0" encoding="UTF-8"?>
   <binding force-classes="true" 
            xmlns:tns="http://...peering.service"; 
            value-style="element">
       <namespace uri="http://...peering.service"; default="elements"/>

       <mapping abstract="true" 
                type-name="tns:AContainee" 
                class="AContainee" ordered="false">
           <value name="id" field="id" usage="optional"/>
           <value name="aContainer" field="aContainer" usage="optional"/>
       </mapping>

       <mapping abstract="true" 
                type-name="tns:AContainer" 
                class="AContainer" ordered="false">
           <value name="name" field="name" usage="optional"/>
           <collection field="aContainees" item-type="AContainee[]"/>
       </mapping>
   </binding>

The JiBX binding compiler runs fine.  Axis2's WSDL2Java runs fine, too.  But 
when I run the WSDL2Java-generated test client, it complains:

   org.apache.axis2.AxisFault: No unmarshaller for element 
"{http://..peering.service}AContainees";
   ...

I then tried to deploy the TypedArrayMapper by adding this to binding.xml:

    <mapping abstract="true" 
             type-name="tns:AContainees"
             class="AContainee[]"
             marshaller="org.jibx.extras.TypedArrayMapper"
             unmarshaller="org.jibx.extras.TypedArrayMapper"/>
    
But it gives me the same runtime error.

I'm obviously missing a mapping definition, but I'm clueless which one.

Any help is greatly appreciated.
-Max

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE 
version of DB2 express and take control of your XML. No limits. Just data. 
Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


This e-mail and any attachment is for authorised use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be copied, 
disclosed to, retained or used by, any other party. If you are not an intended 
recipient then please promptly delete this e-mail and any attachment and all 
copies and inform the sender. Thank you.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to