That's right. Stick with arrays. Just say "no" to colllections.

- Anne


On Wed, 23 Feb 2005 13:55:44 +0100, Mariano Eloy Fern�ndez
<[EMAIL PROTECTED]> wrote:
> Hello,
> 
> Patrick, an advise from a fool.
> Use MyClass[] instead of Vector or Collections, mainly becouse that way
> you provide the wrapped type to Axis' De/Serializers.
> 
> Cheers,
> 
> Mariano Eloy Fern�ndez..
> 
> Patrick van Kann wrote:
> 
> > I have integrated Axis 1.2 RC2 binary with an existing web app. I have
> > a simple web service defined in my server-config.wsdd as follows:
> >
> > <service
> >         name="TimesheetWebService"
> >         provider="java:RPC">
> >         <parameter name="allowedMethods" value="*"/>
> >         <parameter name="className"
> > value="com.fc.timesheet.webservices.TimesheetWebService"/>
> >         <beanMapping
> > languageSpecificType="java:com.fc.timesheet.data.TestData"
> >                 qname="ns1:Test" xmlns:ns1="urn:data.timesheet.fc.com"/>
> > </service>
> >
> > It has a single method that returns a simple JavaBean of type TestData.
> >
> > The TestData JavaBean has a member that is a Vector:
> >
> > private Vector tests = new Vector();
> >
> > public Vector getTests() {
> >         return this.tests;
> > }
> >
> > public void setTests( Vector tests ) {
> >         this.tests = tests;
> > }
> >
> > If I generate the client and test case using WSDL2Java (based on the
> > WSDL that the Axis Servlet produces automatically) the test case runs
> > just fine.
> >
> > However, if I change my TestData class to have a Collection (backed by
> > an ArrayList) instead i.e.:
> >
> > private Collection tests = new ArrayList();
> >
> > public Collection getTests() {
> >         return this.tests;
> > }
> >
> > public void setTests( Collection tests ) {
> >         this.tests = tests;
> > }
> >
> > I get an error when I try re-deploy to the server and re-generate and
> > re-run the client/test case:
> >
> > "org.xml.sax.SAXException: Found character data inside an array
> > element while deserializing"
> >
> > What do I need to do differently to handle Collections/ArrayLists?
> >
> > Thanks in advance,
> >
> > Patrick
> >
> 
>

Reply via email to