Using XFire as a client - inheritance not working
-------------------------------------------------

                 Key: XFIRE-976
                 URL: http://jira.codehaus.org/browse/XFIRE-976
             Project: XFire
          Issue Type: Bug
    Affects Versions: 1.2.5
         Environment: OS X, Java 5
            Reporter: Jesse McLaughlin
            Assignee: Dan Diephouse



I am using XFire to consume a web-service.  The web-service itself is served by 
a different technology (ie. not XFire).  Basically my problem is that my XFire 
client is deserializing the object it receives into the wrong type - such that 
if I have:

   class A {};
   class B extends A {};

...then when the service returns B, my XFire client actually deserializes it as 
an instance of A.

I have used TCPMon to inspect the XML being received from the server - it 
includes an "xsi:type='myns:B'" tag, which I would have thought would prompt 
XFire to instantiate B, not A.  Both A and B are referenced in the WSDL (via 
imports of dependent *.xsd files).

Of course, the WSDL references A as the return type, and the generated code 
uses an A to refer to the result, but this should be right since the WSDL does 
not know what kind of concrete A will actually be returned on any given 
invocation of the web-service.

I did notice that if I hack the generated code and change the setter that sets 
A to actually take B as the value to set, it suddenly starts deserializing the 
received object correctly!  Of course that then precludes receiving C, D, etc., 
if they also extend A.

Can someone tell me if this is a known issue, or if there is something I can 
try to make it work?

If this is a known issue, sorry if I duped it, but all the other bug reports 
seem to be talking about using XFire as a service exporter as opposed to a 
client, as in my case.

Thanks.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

    http://xircles.codehaus.org/manage_email

Reply via email to