Hi,

I found the problem is not at the client, but the server is not properly
setup to serialize the inherited classes..

Here is what my spring context file has on the server..

<bean name="service" parent="abstractServiceBean">
    <property name="serviceBean" ref="manager" />
    <property name="serviceClass" value="com.test.Service" />
                
    <!-- Must override activites, otherwise inheritence won't work  -->
    <property name="properties">
      <map><entry key="writeXsiType"><value
type="java.lang.Boolean">true</value></entry>
           <entry key="overrideTypesList">
             <list><value>com.test.A</value>
                   <value>com.test.B</value>                   
             </list>
               </entry>
      </map>
    </property>
  </bean>

Is there something else I need to set at server..

Thanks
Srinivas.


velidandas wrote:
> 
> Hi,
> 
> I have a java swing application as a client to talk to a server passing
> some serializable objects
> over the network.
> 
> Using the below code to create the client
> 
>         HashMap props = new HashMap();        
>         props.put(AegisBindingProvider.WRITE_XSI_TYPE_KEY, Boolean.TRUE);
>         ArrayList list = new ArrayList();
>         list.add(A.class.getName());
>         list.add(B.class.getName()); //class B extends A             
>         props.put(AegisBindingProvider.OVERRIDE_TYPES_KEY, list);
>             
>             //if(serviceCode == WEBSERVICE) {
>         Service serviceModel =
>                 new ObjectServiceFactory().create(Service.class,props);
>         logger.info("got service model.");
> 
>         // Create a proxy for the deployed service
>         XFire xfire = XFireFactory.newInstance().getXFire();
>         XFireProxyFactory factory = new XFireProxyFactory(xfire);
>         String serviceUrl = "http://localhost:8080/services/Service
>         logger.info("about to create client");
>         Service client1 = (Service) factory.create(serviceModel,
> serviceUrl);
>         //serviceMethod() will have both B and A objects in the array..
>         A[] results = client1.serviceMethod();
> 
> The above code is working fine from a JUnit test case and also from
> standalone java app, returning
> either types of objects properly, but while trying the same from Netbeans
> application developed using Netbeans 5.0 IDE the subclass object is always
> getting converted to super class object and could not get the data
> specific to subclass object.
> 
> Could someone let me know how to fix this problem.
> 
> Thanks in advance,
> Srinivas.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/XFire-client-with-aegis-inheritance-not-working...-tp14293772p14310216.html
Sent from the XFire - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to