You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by gr...@gmx.at on 2005/12/29 19:01:05 UTC

Problem serializing array of complex types

Hi!
I'm using WSDL2Java to generate Java-files from a customers WSDL-files.
These WSDL-files use complex types containing arrays of other complex types.
Till now we used 1.1RC2 to generate the Java-files. This worked well
serializing the array to somthing like this:

     <X soapenc:arrayType="ns2:Y[2]" xmlns:ns2="..." xmlns:soapenc="...">
      <item>
       <ADR_TYP>M</ADR_TYP>
       <ADRESSEN_EXTRA xsi:nil="true"/>
      </item>
      <item>
       <ADR_TYP>M</ADR_TYP>
       <ADRESSEN_EXTRA xsi:nil="true"/>
      </item>
     </X>
     
Now I tried the same with Axis 1.2 and 1.3 and got somthing like that

  <X>
     <ADR_TYP>M</ADR_TYP>
     <ADRESSEN_EXTRA xsi:nil="true"/>
  </X>
  <X>
     <ADR_TYP>M</ADR_TYP>
     <ADRESSEN_EXTRA xsi:nil="true"/>
  </X>

The WSDL in both cases is the same. I think I've tried each available
switch, but the result stays the same.

Is this a bug or what am I doing wrong?

Thanks in advance,
Grmlfz

-- 
DSL-Aktion wegen gro�er Nachfrage bis 28.2.2006 verl�ngert:
GMX DSL-Flatrate 1 Jahr kostenlos* http://www.gmx.net/de/go/dsl

Re: Problem serializing array of complex types

Posted by gr...@gmx.at.
Hi iksrazal!
I must admit I'm not an expert but:
Comparing the Java-files produced with 1.1RC2 with those produced with newer
releases there seems to be one relevant difference: 

1.1RC2 sets the XmlType in the following way:
elemField.setXmlType(new javax.xml.namespace.QName("http://...",
"ArrayOfY"));
        typeDesc.addFieldDesc(elemField);

the newer ones do it like this:
elemField.setXmlType(new javax.xml.namespace.QName("http://...", "Y"));
        typeDesc.addFieldDesc(elemField);

So the prefix "ArrayOf" is missing. If I add "ArrayOf" manually to the
generated code everything works great. So I think it is not a schema
question. 
Thanx,
Grmlfz

> --- Ursprüngliche Nachricht ---
> Von: iksrazal <ik...@gmail.com>
> An: axis-user@ws.apache.org
> Betreff: Re: Problem serializing array of complex types
> Datum: Thu, 29 Dec 2005 16:26:13 -0200
> 
> Grmlfz, 
> 
> I'm not understanding your problem. I've used those evil soapenc arrays
> quite 
> a bit. What's does or doesn't it do? Your wsdl files are the same always, 
> right ? What you show different is seemingly schema stuff, which doesn't
> have 
> anything to do with wsdl2java. 
> 
> Try clarifying your question a bit. (Maybe its the holidays and I'm not 
> thinking clearly yet). What result stays the same? From where? 
> 
> iksrazal
> http://www.braziloutsource.com/
> 
> Em Quinta 29 Dezembro 2005 16:01, o grmlfz@gmx.at escreveu:
> > Hi!
> > I'm using WSDL2Java to generate Java-files from a customers WSDL-files.
> > These WSDL-files use complex types containing arrays of other complex
> > types. Till now we used 1.1RC2 to generate the Java-files. This worked
> well
> > serializing the array to somthing like this:
> >
> >      <X soapenc:arrayType="ns2:Y[2]" xmlns:ns2="..."
> xmlns:soapenc="...">
> >       <item>
> >        <ADR_TYP>M</ADR_TYP>
> >        <ADRESSEN_EXTRA xsi:nil="true"/>
> >       </item>
> >       <item>
> >        <ADR_TYP>M</ADR_TYP>
> >        <ADRESSEN_EXTRA xsi:nil="true"/>
> >       </item>
> >      </X>
> >
> > Now I tried the same with Axis 1.2 and 1.3 and got somthing like that
> >
> >   <X>
> >      <ADR_TYP>M</ADR_TYP>
> >      <ADRESSEN_EXTRA xsi:nil="true"/>
> >   </X>
> >   <X>
> >      <ADR_TYP>M</ADR_TYP>
> >      <ADRESSEN_EXTRA xsi:nil="true"/>
> >   </X>
> >
> > The WSDL in both cases is the same. I think I've tried each available
> > switch, but the result stays the same.
> >
> > Is this a bug or what am I doing wrong?
> >
> > Thanks in advance,
> > Grmlfz
> 
> -- 
> 

-- 
DSL-Aktion wegen großer Nachfrage bis 28.2.2006 verlängert:
GMX DSL-Flatrate 1 Jahr kostenlos* http://www.gmx.net/de/go/dsl

Re: Problem serializing array of complex types

Posted by iksrazal <ik...@gmail.com>.
Grmlfz, 

I'm not understanding your problem. I've used those evil soapenc arrays quite 
a bit. What's does or doesn't it do? Your wsdl files are the same always, 
right ? What you show different is seemingly schema stuff, which doesn't have 
anything to do with wsdl2java. 

Try clarifying your question a bit. (Maybe its the holidays and I'm not 
thinking clearly yet). What result stays the same? From where? 

iksrazal
http://www.braziloutsource.com/

Em Quinta 29 Dezembro 2005 16:01, o grmlfz@gmx.at escreveu:
> Hi!
> I'm using WSDL2Java to generate Java-files from a customers WSDL-files.
> These WSDL-files use complex types containing arrays of other complex
> types. Till now we used 1.1RC2 to generate the Java-files. This worked well
> serializing the array to somthing like this:
>
>      <X soapenc:arrayType="ns2:Y[2]" xmlns:ns2="..." xmlns:soapenc="...">
>       <item>
>        <ADR_TYP>M</ADR_TYP>
>        <ADRESSEN_EXTRA xsi:nil="true"/>
>       </item>
>       <item>
>        <ADR_TYP>M</ADR_TYP>
>        <ADRESSEN_EXTRA xsi:nil="true"/>
>       </item>
>      </X>
>
> Now I tried the same with Axis 1.2 and 1.3 and got somthing like that
>
>   <X>
>      <ADR_TYP>M</ADR_TYP>
>      <ADRESSEN_EXTRA xsi:nil="true"/>
>   </X>
>   <X>
>      <ADR_TYP>M</ADR_TYP>
>      <ADRESSEN_EXTRA xsi:nil="true"/>
>   </X>
>
> The WSDL in both cases is the same. I think I've tried each available
> switch, but the result stays the same.
>
> Is this a bug or what am I doing wrong?
>
> Thanks in advance,
> Grmlfz

--