I have a similar problem, see http://marc.theaimsgroup.com/?l=axis-user&m=113328879314269&w=2

 

Christophe

 


From: françois françois [mailto:[EMAIL PROTECTED]
Sent: Friday, January 20, 2006 5:50 AM
To: [email protected]
Subject: Re: problems to migrate from AXIS 1.2.1 to AXIS 1.3 array serialization BUGS OR NOT?

 

Hi

 

i look in the code source of axis 1.2.1 and 1.3

 

so I look in the axis code 1.3:

 

package org.apache.axis.encoding.SerializationContext

class SerializationContext:

private void serializeActual(QName elemQName,
                                Attributes attributes,
                                Object value,
                                QName xmlType,
                                Class javaClass,
                                Boolean sendType)
        throws IOException
    {...........

    Class javaType = getActualJavaClass(xmlType, javaClass, value);
           
 
in axis  code 1.2.1:


       private void serializeActual(QName elemQName,
                                Attributes attributes,
                                Object value,
                                QName xmlType,
                                Boolean sendType)
        throws IOException
    {
        .......

        if (value != null) {
            Class javaType = value.getClass();
            TypeMapping tm = getTypeMapping();


I tried to replace in axis 1.3  getActualJavaClass(xmlType, javaClass, value) with value.getClass() likein AXIS 1.2.1;
now it seems to work but i don't know if it is the good solution.....
perhaps the problem seems to be in the method getActualJavaClass.

what do you think? is anyone found this problem?

i report it in axis developer forum.

 

thanks

 

 

françois françois <[EMAIL PROTECTED]> a écrit :

Hi Dies

 

I give you another examples with the same problems

 

 

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:testservices" xmlns:impl="urn:testservices" xmlns:intf="urn:testservices" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns1="http://echange.soapsoo.applicatif.prototype.clara" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<!--WSDL created by Apache Axis version: 1.3
Built on Oct 05, 2005 (05:23:37 EDT)-->
 <wsdl:types>
  <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:testservices" elementFormDefault="qualified">
   <import namespace="http://echange.soapsoo.applicatif.prototype.clara"/>
   <element name="retourneBeanArticle">
    <complexType/>
   </element>
   <element name="retourneBeanArticleResponse">
    <complexType>
     <sequence>
      <element name="retourneBeanArticleReturn" type="tns1:BeanArticleSoap" maxOccurs="unbounded"/>
     </sequence>
    </complexType>
   </element>
   <complexType name="ArrayOf_xsd_anyType">
    <sequence>
     <el ement name="item" type="xsd:anyType" minOccurs="0" maxOccurs="unbounded"/>
    </sequence>
   </complexType>
  </schema>
  <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://echange.soapsoo.applicatif.prototype.clara" elementFormDefault="qualified">
   <import namespace="urn:testservices"/>
   <complexType abstract="true" name="BeanEchangeSoap">
    <sequence>
     <element name="description" nillable="true" type="xsd:string"/>
     <element name="nom" nillable="true" type="xsd:string"/>
     <element name="id" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
  ;   <complexType abstract="true" name="BeanArticleSoap">
    <complexContent>
     <extension base="tns1:BeanEchangeSoap">
      <sequence>
       <element name="dateCommercialisation" nillable="true" type="xsd:dateTime"/>
       <element name="lesMarches" nillable="true" type="impl:ArrayOf_xsd_anyType"/>
       <element name="idCatalogueRattachement" nillable="true" type="xsd:string"/>
      </sequence>
     </extension>
    </complexContent>
   </complexType>
    <complexType name="BeanMaterielSoap">
    <complexContent>
     <extension base="tns1:BeanArticleSoap">
      <sequence>
       <element name="prix" type="xsd:float"/>
       <element name="couleur" nillable="true"
        type="xsd:string"/>
      </sequence>
     </extension>
    </complexContent>
   </complexType>
   <complexType name="BeanMarcheSoap">
    <complexContent>
     <extension base="tns1:BeanEchangeSoap">
      <sequence/>
     </extension>
    </complexContent>
   </complexType>
  
  </schema>
 </wsdl:types>

   <wsdl:message name="retourneBeanArticleRequest">

      <wsdl:part name="parameters" element="impl:retourneBeanArticle"/>

   </wsdl:message>

   <wsdl:message name="retourneBeanArticleResponse">

      <wsdl:part name="parameters" element="impl:retourneBeanArticleResponse"/>

   </wsdl:message>

   <wsdl:portType name="ServiceTest">

      <wsdl:operation name="retourneBeanArticle">

         <wsdl:input name="retourneBeanArticleRequest" message="impl:retourneBeanArticleRequest"/>

         <wsdl:output name="retourneBeanArticleResponse" message="impl:retourneBeanArticleResponse"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="ServicesSoapBinding" type="impl:ServiceTest">

      <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="retourneBeanArticle">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="retourneBeanArticleRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="retourneBeanArticleResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="ServiceTestService">

      <wsdl:port name="Services" binding="impl:ServicesSoapBinding">

         <wsdlsoap:address location="http://localhost:9000/TestService/services/Services"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>

wsd d:

<service name="Services" provider="java:RPC" style="wrapped" use="literal">
 <wsdlFile>/wsdl/TestService.wsdl</wsdlFile>
      <parameter name="wsdlTargetNamespace" value="urn:testservices"/>
      <parameter name="wsdlServiceElement" value="ServiceTestService"/>
      <parameter name="schemaQualified" value="http://echange.soapsoo.applicatif.prototype.clara,urn:testservices"/>
      <parameter name="wsdlServicePort" value="Services"/>
      <parameter name="className" value="test.heritage.ServiceTestImpl"/>
      <parameter name="wsdlPortType" value="ServiceTest"/>
      <parameter name="typeMappingVersion" value="1.2"/>
      <operation name="retourneBeanArticle" qname="operNS:retourneBeanArticle" xmlns:operNS="urn:testservices" returnQName="retNS:retourneBeanArticleReturn" xmlns:retNS="urn:testservices" returnType="rtns:BeanArticleSoap" xmlns:rtns="http://echange.soapsoo.applicatif.prototype.clara" soapAction="">
      </operation>
      <parameter name="allowedMethods" value="retourneBeanArticle"/>

   
      <typeMapping xmlns:ns="http://echange.soapsoo.applicatif.prototype.clara" qname="ns:BeanMaterielSoap" type="java:clara.prototype.applicatif.soapsoo.echange.BeanMaterielSoap" serializer="org.apache.axis.encoding.ser.BeanSerializerFactory" deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory" encodingStyle=""/>
      <arrayMapping xmlns:ns="urn:testservices" qname="ns:ArrayOf_xsd_anyType" type="java:java.lang.Object[]" innerType="cmp-ns:anyType" xmlns:cmp-ns="http://www.w3.org/2001/XMLSchema" encodingStyle=""/>
      <typeMapping xmlns:ns="http://echange.soapsoo.applicatif.prototype.clara" qname="ns:BeanArticleSoap" type="java:clara.prototype.applicatif.soapsoo.echange.BeanArticleSoap" serializer="org.apache.axis.encoding.ser.BeanSerializerFactory" deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory" encodingStyle=""/>
      <typeMapping xmlns:ns="http://echange.soapsoo.applicatif.prototype.clara" qname="ns:BeanMarcheSoap" type="java:clara.prototype.applicatif.soapsoo.echange.BeanMarcheSoap" serializer="org.apache.axis.encoding.ser.BeanSerializerFactory" deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory" encodingStyle=""/>
      <typeMapping xmlns:ns="http://echange.soapsoo.applicatif.prototype.clara" qname="ns:BeanEchangeSoap" type="java:clara.prototype.applicatif.soapsoo.echange.BeanEchangeSoap" serializer="org.apache.axis.encoding.ser.BeanSerializerFactory" deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory" encodingStyle=""/>
      <arrayMapping xmlns:ns="urn:testservices" qname="ns:&gt;retourneBeanArticleResponse" type="java:clara.prototype.applicatif.soapsoo.echange.BeanArticleSoap[]" innerType="cmp-ns:BeanArticleSoap" xmlns:cmp-ns="http://echange.soapsoo.applicatif.prototype.clara" encodingStyle=""/>
  </service>

 

class java:

public class ServiceTestImpl implements ServiceTest {

    public static void main(String[] args) {
    }

     public BeanArticleSoap[] retourneBeanArticle() {
        
        BeanArticleSoap[] tab= new BeanArticleSoap[1];
        Date d= new Date("12/10/06");
        BeanMarcheSoap marche= new BeanMarcheSoap("Marchéexemple","marche entreprise","3");
        Vector marches = new Vector();
        marches.add(marche);
      & amp;n bsp; BeanMaterielSoap mater=new BeanMaterielSoap("2","tondeuse","aucune",d,"3",marches.toArray(),"rouge",12);
        BeanArticleSoap art=mater;
        tab[0]=(BeanMaterielSoap)mater;
       
       
        return tab;
    }
}

 

i have done a wsdl2java to generate the java files

 

thanks.

 

 


Dies Koper <[EMAIL PROTECTED]> a écrit :

Hello François,

I'd like to try to reproduce your problem. Could you post a (small) WSDL
file, client and impl file to do this?
I'm wondering where the problem is.. WSDD, SOAP message..

Regards,
Dies


françois françois wrote:
> Hi everybody
>
> i have tried to migrate from axis 1.2.1 to axis 1.3
> it seems that the ArraySerializer has changed between this 2 versions
> and it caused some problems with inheritance:
> If you ve got for example: an abstract class animal and a class dog who extends animal
> and an Array of animal
> so in this way :
> public abstract class Animal{
> private String nom;
> ......
> }
> public class Dog extends Animal{
> private String color;
> ........
> }
> your webservice expose this method below for example:
> public Animal [] getListOfAnimals(){
> Animal [] array_Animals=new Animals[1];
> Dog doggy= new doggy("pluto","black");
> array_Animals[0]=doggy;
> return array_Animals;
> }
> In axis 1.3 when you call getListOfAnimals(), you lost the informations of Dog so you receive to your client
> only an array which contains Animal type Object but not Dog objects and the client failed : instantiation exception....
> In axis 1.2.1 you still have the information that the function getListOfAnimals() return an array of Animal which contains
> Dog objects.
> It happens only with array, i have tried to do other examples in many ways i have got the same problems...
> I use document wrapped/literal.
> Has someone got the same problems ?any explanations? is it a bugs?
> Thank you.
>
>
>
> ---------------------------------
> Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.Téléchargez la version beta.

--
Dies KOPER <[EMAIL PROTECTED]>(changed on 1 July 2005)
Fujitsu Ltd - MWPF1 (changed from MWPF3 on 21 Nov 2005)
2-15-16, Shin-Yokohama, Kouhoku-ku, Yokohama, 222-0033, Japan
Tel. +81(45)-475-5605 (internal 7181-4217)

 


Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international. Téléchargez la version beta.

 


Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international. Téléchargez la version beta.

Reply via email to