Hi,

I am using XFire for a soap web service. The web service
schema has a case wherein there are types which can extend another
type. So, after I generate the classes with xfire, the hierarchy looks
something like this - 

public class T {
}
public class A extends T {
}
public class B extends T {
}

When
I make a call to the web service and try to check the instance of the
returned object, it always returns the instance of the super class
instead of the sub classes in cases where it should not be like that.
I
have read about this a lot on this list and others. I have seen that
many have encountered the same problem. There are places where I have
read that in xfire versions later than 1.2 should support this
automatically and others where a manual way to fix this is mentioned.
So, I followed that and tried to fix it manually in my client code
something like this -

List<String> searchPackage = new ArrayList<String>(); 
searchPackage.add("com.mypackage"); 
service.setProperty(JaxbType.SEARCH_PACKAGES,searchPackage);

where
com.mypackage is the package where all the classes(A,B,T) are placed
and service is my Service Factory object. I use jaxb2 for bindings. 

But even this does not solve my problem. I still get the object of the super 
class. Any clues on how I can fix this ? 

If
it helps , I am using xfire-1.2.5, jdk-1.6 ( tried it with 1.5 also),
jaxb2 ( jaxb-xjc-2.0.2.jar, jaxb-api.jar, jaxb-impl.jar,
jaxrpc-api.jar, jaxrpc-impl.jar, jaxrpc-spi.jar, jdom-1.jar,
jaxws20ea3.jar, jsr173_1.0_api.jar).

Thanks
Shally 


      Chat on a cool, new interface. No download required. Go to 
http://in.messenger.yahoo.com/webmessengerpromo.php

Reply via email to