You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Olivier Jacquemin (JIRA)" <ji...@apache.org> on 2007/07/03 17:17:05 UTC

[jira] Created: (CXF-759) Inheritance deserialization problem

Inheritance deserialization problem
-----------------------------------

                 Key: CXF-759
                 URL: https://issues.apache.org/jira/browse/CXF-759
             Project: CXF
          Issue Type: Bug
    Affects Versions: 2.0-RC
         Environment: Win XP, .NET SOAP Web Service
            Reporter: Olivier Jacquemin


I am currently in the process of selecting a mechanism for building a java client for a SOAP Web Services API developed in .NET.  This API is fairly simple, except for a point: some data structures returned are relatively complex and involve inheritance.

In this case, these object structures don't seem to be correctly deserialized.

A detailed description follows: if anyone could help me either
- improving the deserialization process in Cxf, or
- obtaining a way to access the raw XML data (or the corresponding parsed object structure) returned, so that the client application can complete the deserialization process itself in an "ad hoc" way,
I would very much appreciate it.


Here is a very simple example after reducing the problem to its simplest form.


/**
 * Web service code
 * C#
 */
[WebMethod]
[XmlInclude(typeof(Dog))]
[SoapInclude(typeof(Dog))]
public Animal getAnimal()
{
    return new Dog("brown");
}

public class Animal // ...
public class Dog : Animal // ...


Here is the XML contained in the response to the invocation of getAnimal(): the xsi:type="Dog" indicates that an instance of the daughter class is returned:

<?xml version="1.0" encoding="utf-8"?>
<Animal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="Dog" xmlns="http://tempuri.org/">
  <species>Dog</species>
  <color>brown</color>
</Animal>


And here is the client code, added to the auto-generated file obtained from 'wsdl2java -client':

/**
 * Client code
 * Java
 */
org.tempuri.Dog dog = null;

System.out.println("Invoking getAnimal...");
org.tempuri.Animal animal = port.getAnimal();

try {
    dog = (Dog)animal;
}
catch (java.lang.ClassCastException e1) {
    e1.printStackTrace();
}
if (dog != null) {
    System.out.println("Color of dog: " + dog.color);
}


The trouble is that the cast from Animal (parent class) to Dog (daughter class) fails: a ClassCastException is thrown.

Many thanks for any help on this issue,

    _Olivier_

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-759) Inheritance deserialization problem

Posted by "Olivier Jacquemin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509904 ] 

Olivier Jacquemin commented on CXF-759:
---------------------------------------

Just tested with latest snapshot of Cxf (June 19, 2007): problem still present.

> Inheritance deserialization problem
> -----------------------------------
>
>                 Key: CXF-759
>                 URL: https://issues.apache.org/jira/browse/CXF-759
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0-RC
>         Environment: Win XP, .NET SOAP Web Service
>            Reporter: Olivier Jacquemin
>         Attachments: CxfInheritancePb.zip
>
>
> I am currently in the process of selecting a mechanism for building a java client for a SOAP Web Services API developed in .NET.  This API is fairly simple, except for a point: some data structures returned are relatively complex and involve inheritance.
> In this case, these object structures don't seem to be correctly deserialized.
> A detailed description follows: if anyone could help me either
> - improving the deserialization process in Cxf, or
> - obtaining a way to access the raw XML data (or the corresponding parsed object structure) returned, so that the client application can complete the deserialization process itself in an "ad hoc" way,
> I would very much appreciate it.
> Here is a very simple example after reducing the problem to its simplest form.
> /**
>  * Web service code
>  * C#
>  */
> [WebMethod]
> [XmlInclude(typeof(Dog))]
> [SoapInclude(typeof(Dog))]
> public Animal getAnimal()
> {
>     return new Dog("brown");
> }
> public class Animal // ...
> public class Dog : Animal // ...
> Here is the XML contained in the response to the invocation of getAnimal(): the xsi:type="Dog" indicates that an instance of the daughter class is returned:
> <?xml version="1.0" encoding="utf-8"?>
> <Animal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="Dog" xmlns="http://tempuri.org/">
>   <species>Dog</species>
>   <color>brown</color>
> </Animal>
> And here is the client code, added to the auto-generated file obtained from 'wsdl2java -client':
> /**
>  * Client code
>  * Java
>  */
> org.tempuri.Dog dog = null;
> System.out.println("Invoking getAnimal...");
> org.tempuri.Animal animal = port.getAnimal();
> try {
>     dog = (Dog)animal;
> }
> catch (java.lang.ClassCastException e1) {
>     e1.printStackTrace();
> }
> if (dog != null) {
>     System.out.println("Color of dog: " + dog.color);
> }
> The trouble is that the cast from Animal (parent class) to Dog (daughter class) fails: a ClassCastException is thrown.
> Many thanks for any help on this issue,
>     _Olivier_

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-759) Inheritance deserialization problem

Posted by "Dan Diephouse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12511297 ] 

Dan Diephouse commented on CXF-759:
-----------------------------------

I was able to get your code to work if I added this to the code:

Client client = ClientProxy.getClient(port);
HTTPConduit c = (HTTPConduit) client.getConduit();
c.getClient().setAllowChunking(false);

This is why I've advocated disabling chunking by default... But there are a couple other important differences:

1. I'm using VS 2005 and you're using an older version
2. I was getting a different exception than you - for some reason the service was giving an HTTP 400 response

Can you try the above code? I'm sort of doubtful it will fix your problem though...  yet, my web service response seems to be the exact same as yours.

> Inheritance deserialization problem
> -----------------------------------
>
>                 Key: CXF-759
>                 URL: https://issues.apache.org/jira/browse/CXF-759
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0-RC
>         Environment: Win XP, .NET SOAP Web Service
>            Reporter: Olivier Jacquemin
>            Assignee: Dan Diephouse
>         Attachments: CxfInheritancePb.zip, CxfInheritancePb_070607.zip, ZooDump.zip
>
>
> I am currently in the process of selecting a mechanism for building a java client for a SOAP Web Services API developed in .NET.  This API is fairly simple, except for a point: some data structures returned are relatively complex and involve inheritance.
> In this case, these object structures don't seem to be correctly deserialized.
> A detailed description follows: if anyone could help me either
> - improving the deserialization process in Cxf, or
> - obtaining a way to access the raw XML data (or the corresponding parsed object structure) returned, so that the client application can complete the deserialization process itself in an "ad hoc" way,
> I would very much appreciate it.
> Here is a very simple example after reducing the problem to its simplest form.
> /**
>  * Web service code
>  * C#
>  */
> [WebMethod]
> [XmlInclude(typeof(Dog))]
> [SoapInclude(typeof(Dog))]
> public Animal getAnimal()
> {
>     return new Dog("brown");
> }
> public class Animal // ...
> public class Dog : Animal // ...
> Here is the XML contained in the response to the invocation of getAnimal(): the xsi:type="Dog" indicates that an instance of the daughter class is returned:
> <?xml version="1.0" encoding="utf-8"?>
> <Animal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="Dog" xmlns="http://tempuri.org/">
>   <species>Dog</species>
>   <color>brown</color>
> </Animal>
> And here is the client code, added to the auto-generated file obtained from 'wsdl2java -client':
> /**
>  * Client code
>  * Java
>  */
> org.tempuri.Dog dog = null;
> System.out.println("Invoking getAnimal...");
> org.tempuri.Animal animal = port.getAnimal();
> try {
>     dog = (Dog)animal;
> }
> catch (java.lang.ClassCastException e1) {
>     e1.printStackTrace();
> }
> if (dog != null) {
>     System.out.println("Color of dog: " + dog.color);
> }
> The trouble is that the cast from Animal (parent class) to Dog (daughter class) fails: a ClassCastException is thrown.
> Many thanks for any help on this issue,
>     _Olivier_

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (CXF-759) Inheritance deserialization problem

Posted by "Dan Diephouse (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-759?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Diephouse closed CXF-759.
-----------------------------

    Resolution: Cannot Reproduce

Chunking should be enabled by default, so I don't know why it would hang. If you send along a WSDL (in a new JIRA issue), we'll take a look though.

> Inheritance deserialization problem
> -----------------------------------
>
>                 Key: CXF-759
>                 URL: https://issues.apache.org/jira/browse/CXF-759
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0-RC
>         Environment: Win XP, .NET SOAP Web Service
>            Reporter: Olivier Jacquemin
>            Assignee: Dan Diephouse
>         Attachments: CxfInheritancePb.zip, CxfInheritancePb_070607.zip, ZooDump.zip
>
>
> I am currently in the process of selecting a mechanism for building a java client for a SOAP Web Services API developed in .NET.  This API is fairly simple, except for a point: some data structures returned are relatively complex and involve inheritance.
> In this case, these object structures don't seem to be correctly deserialized.
> A detailed description follows: if anyone could help me either
> - improving the deserialization process in Cxf, or
> - obtaining a way to access the raw XML data (or the corresponding parsed object structure) returned, so that the client application can complete the deserialization process itself in an "ad hoc" way,
> I would very much appreciate it.
> Here is a very simple example after reducing the problem to its simplest form.
> /**
>  * Web service code
>  * C#
>  */
> [WebMethod]
> [XmlInclude(typeof(Dog))]
> [SoapInclude(typeof(Dog))]
> public Animal getAnimal()
> {
>     return new Dog("brown");
> }
> public class Animal // ...
> public class Dog : Animal // ...
> Here is the XML contained in the response to the invocation of getAnimal(): the xsi:type="Dog" indicates that an instance of the daughter class is returned:
> <?xml version="1.0" encoding="utf-8"?>
> <Animal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="Dog" xmlns="http://tempuri.org/">
>   <species>Dog</species>
>   <color>brown</color>
> </Animal>
> And here is the client code, added to the auto-generated file obtained from 'wsdl2java -client':
> /**
>  * Client code
>  * Java
>  */
> org.tempuri.Dog dog = null;
> System.out.println("Invoking getAnimal...");
> org.tempuri.Animal animal = port.getAnimal();
> try {
>     dog = (Dog)animal;
> }
> catch (java.lang.ClassCastException e1) {
>     e1.printStackTrace();
> }
> if (dog != null) {
>     System.out.println("Color of dog: " + dog.color);
> }
> The trouble is that the cast from Animal (parent class) to Dog (daughter class) fails: a ClassCastException is thrown.
> Many thanks for any help on this issue,
>     _Olivier_

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-759) Inheritance deserialization problem

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-759?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp updated CXF-759:
----------------------------

    Attachment: CxfInheritancePb_070607.zip


This seems like it may be a problem on the .NET side.   I run Linux so I couldn't use the .net server, but I wrote a quick CXF based server (attached a new zip file with it included) that returns a dog.    I verified the "on the wire" with a wireshark dump and see:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <getAnimalResponse xmlns="http://tempuri.org/">
            <getAnimalResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Dog">
                <species>Dog</species>
                <color>brown</color>
            </getAnimalResult>
        </getAnimalResponse>
    </soap:Body>
</soap:Envelope>


The client then does get:
Invoking getAnimal...
Color of dog: brown
Invoking getAnimals...
Number of animals returned: 1
Color of dog: brown

Thus, it looks like its working if the on the wire message is correct.   Is there anyway you could TCPdump or otherwise capture the full on the wire message so I can check if it's actually OK?

Dan




> Inheritance deserialization problem
> -----------------------------------
>
>                 Key: CXF-759
>                 URL: https://issues.apache.org/jira/browse/CXF-759
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0-RC
>         Environment: Win XP, .NET SOAP Web Service
>            Reporter: Olivier Jacquemin
>         Attachments: CxfInheritancePb.zip, CxfInheritancePb_070607.zip
>
>
> I am currently in the process of selecting a mechanism for building a java client for a SOAP Web Services API developed in .NET.  This API is fairly simple, except for a point: some data structures returned are relatively complex and involve inheritance.
> In this case, these object structures don't seem to be correctly deserialized.
> A detailed description follows: if anyone could help me either
> - improving the deserialization process in Cxf, or
> - obtaining a way to access the raw XML data (or the corresponding parsed object structure) returned, so that the client application can complete the deserialization process itself in an "ad hoc" way,
> I would very much appreciate it.
> Here is a very simple example after reducing the problem to its simplest form.
> /**
>  * Web service code
>  * C#
>  */
> [WebMethod]
> [XmlInclude(typeof(Dog))]
> [SoapInclude(typeof(Dog))]
> public Animal getAnimal()
> {
>     return new Dog("brown");
> }
> public class Animal // ...
> public class Dog : Animal // ...
> Here is the XML contained in the response to the invocation of getAnimal(): the xsi:type="Dog" indicates that an instance of the daughter class is returned:
> <?xml version="1.0" encoding="utf-8"?>
> <Animal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="Dog" xmlns="http://tempuri.org/">
>   <species>Dog</species>
>   <color>brown</color>
> </Animal>
> And here is the client code, added to the auto-generated file obtained from 'wsdl2java -client':
> /**
>  * Client code
>  * Java
>  */
> org.tempuri.Dog dog = null;
> System.out.println("Invoking getAnimal...");
> org.tempuri.Animal animal = port.getAnimal();
> try {
>     dog = (Dog)animal;
> }
> catch (java.lang.ClassCastException e1) {
>     e1.printStackTrace();
> }
> if (dog != null) {
>     System.out.println("Color of dog: " + dog.color);
> }
> The trouble is that the cast from Animal (parent class) to Dog (daughter class) fails: a ClassCastException is thrown.
> Many thanks for any help on this issue,
>     _Olivier_

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-759) Inheritance deserialization problem

Posted by "Olivier Jacquemin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12511462 ] 

Olivier Jacquemin commented on CXF-759:
---------------------------------------

Thank you Dan,

When trying to make the code compile after inserting your 3 lines, I noticed a very basic fact: the CXF jar was neither on the build path nor in the classpath.  No hope of hiding any longer that don't have much experience with Java ;-)
Note that without these 3 lines, the code compiles and runs without any reference to the CXF jar! Is this normal? Could it be related to the jdk1.6.0 that is used? I'll install jdk1.5.0 and see if things are different.

After adding the cxf-2.0-incubator.jar to the build path, everything compiles.  I then have to add some other jar files to the classpath for the program to run without throwing exceptions: wsdl4j-1.6.1.jar, xml-resolver-1.2.jar, XmlSchema-1.2.jar, jaxb-impl-2.0.5.jar, geronimo-javamail_1.4_spec-1.0-M1.jar.  cxf-2.0-incubator.jar had already been added by eclipse.

After this the client program succeeds in casting Animal to Dog, with or without the 3 lines...

However, they proved very useful on my real client program which involves
- larger data structures returned, and
- "integrated Windows authentication".
To make it work, I also had to use the local path of the WSDL file as an argument.
With the URL of the WSDL the program hangs upon web service object creation:
    new MyWebService(wsdlURL, SERVICE_NAME)
It seems to me that the WSDL file is too big and authentication fails because chunking is not yet disabled.  What do you think? Is there a way to disable chunking before creation of the web service?

Many thanks again,

  _Olivier_

> Inheritance deserialization problem
> -----------------------------------
>
>                 Key: CXF-759
>                 URL: https://issues.apache.org/jira/browse/CXF-759
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0-RC
>         Environment: Win XP, .NET SOAP Web Service
>            Reporter: Olivier Jacquemin
>            Assignee: Dan Diephouse
>         Attachments: CxfInheritancePb.zip, CxfInheritancePb_070607.zip, ZooDump.zip
>
>
> I am currently in the process of selecting a mechanism for building a java client for a SOAP Web Services API developed in .NET.  This API is fairly simple, except for a point: some data structures returned are relatively complex and involve inheritance.
> In this case, these object structures don't seem to be correctly deserialized.
> A detailed description follows: if anyone could help me either
> - improving the deserialization process in Cxf, or
> - obtaining a way to access the raw XML data (or the corresponding parsed object structure) returned, so that the client application can complete the deserialization process itself in an "ad hoc" way,
> I would very much appreciate it.
> Here is a very simple example after reducing the problem to its simplest form.
> /**
>  * Web service code
>  * C#
>  */
> [WebMethod]
> [XmlInclude(typeof(Dog))]
> [SoapInclude(typeof(Dog))]
> public Animal getAnimal()
> {
>     return new Dog("brown");
> }
> public class Animal // ...
> public class Dog : Animal // ...
> Here is the XML contained in the response to the invocation of getAnimal(): the xsi:type="Dog" indicates that an instance of the daughter class is returned:
> <?xml version="1.0" encoding="utf-8"?>
> <Animal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="Dog" xmlns="http://tempuri.org/">
>   <species>Dog</species>
>   <color>brown</color>
> </Animal>
> And here is the client code, added to the auto-generated file obtained from 'wsdl2java -client':
> /**
>  * Client code
>  * Java
>  */
> org.tempuri.Dog dog = null;
> System.out.println("Invoking getAnimal...");
> org.tempuri.Animal animal = port.getAnimal();
> try {
>     dog = (Dog)animal;
> }
> catch (java.lang.ClassCastException e1) {
>     e1.printStackTrace();
> }
> if (dog != null) {
>     System.out.println("Color of dog: " + dog.color);
> }
> The trouble is that the cast from Animal (parent class) to Dog (daughter class) fails: a ClassCastException is thrown.
> Many thanks for any help on this issue,
>     _Olivier_

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-759) Inheritance deserialization problem

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510776 ] 

Daniel Kulp commented on CXF-759:
---------------------------------


Actually, I should add I was testing with cxf/trunk, not the 2.0 release.   Thus, it might be fixed there.


> Inheritance deserialization problem
> -----------------------------------
>
>                 Key: CXF-759
>                 URL: https://issues.apache.org/jira/browse/CXF-759
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0-RC
>         Environment: Win XP, .NET SOAP Web Service
>            Reporter: Olivier Jacquemin
>         Attachments: CxfInheritancePb.zip, CxfInheritancePb_070607.zip
>
>
> I am currently in the process of selecting a mechanism for building a java client for a SOAP Web Services API developed in .NET.  This API is fairly simple, except for a point: some data structures returned are relatively complex and involve inheritance.
> In this case, these object structures don't seem to be correctly deserialized.
> A detailed description follows: if anyone could help me either
> - improving the deserialization process in Cxf, or
> - obtaining a way to access the raw XML data (or the corresponding parsed object structure) returned, so that the client application can complete the deserialization process itself in an "ad hoc" way,
> I would very much appreciate it.
> Here is a very simple example after reducing the problem to its simplest form.
> /**
>  * Web service code
>  * C#
>  */
> [WebMethod]
> [XmlInclude(typeof(Dog))]
> [SoapInclude(typeof(Dog))]
> public Animal getAnimal()
> {
>     return new Dog("brown");
> }
> public class Animal // ...
> public class Dog : Animal // ...
> Here is the XML contained in the response to the invocation of getAnimal(): the xsi:type="Dog" indicates that an instance of the daughter class is returned:
> <?xml version="1.0" encoding="utf-8"?>
> <Animal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="Dog" xmlns="http://tempuri.org/">
>   <species>Dog</species>
>   <color>brown</color>
> </Animal>
> And here is the client code, added to the auto-generated file obtained from 'wsdl2java -client':
> /**
>  * Client code
>  * Java
>  */
> org.tempuri.Dog dog = null;
> System.out.println("Invoking getAnimal...");
> org.tempuri.Animal animal = port.getAnimal();
> try {
>     dog = (Dog)animal;
> }
> catch (java.lang.ClassCastException e1) {
>     e1.printStackTrace();
> }
> if (dog != null) {
>     System.out.println("Color of dog: " + dog.color);
> }
> The trouble is that the cast from Animal (parent class) to Dog (daughter class) fails: a ClassCastException is thrown.
> Many thanks for any help on this issue,
>     _Olivier_

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-759) Inheritance deserialization problem

Posted by "Olivier Jacquemin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-759?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Jacquemin updated CXF-759:
----------------------------------

    Attachment: CxfInheritancePb.zip

The full source code of the web service and the client, as well as the WSDL file, are attached to this issue.

> Inheritance deserialization problem
> -----------------------------------
>
>                 Key: CXF-759
>                 URL: https://issues.apache.org/jira/browse/CXF-759
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0-RC
>         Environment: Win XP, .NET SOAP Web Service
>            Reporter: Olivier Jacquemin
>         Attachments: CxfInheritancePb.zip
>
>
> I am currently in the process of selecting a mechanism for building a java client for a SOAP Web Services API developed in .NET.  This API is fairly simple, except for a point: some data structures returned are relatively complex and involve inheritance.
> In this case, these object structures don't seem to be correctly deserialized.
> A detailed description follows: if anyone could help me either
> - improving the deserialization process in Cxf, or
> - obtaining a way to access the raw XML data (or the corresponding parsed object structure) returned, so that the client application can complete the deserialization process itself in an "ad hoc" way,
> I would very much appreciate it.
> Here is a very simple example after reducing the problem to its simplest form.
> /**
>  * Web service code
>  * C#
>  */
> [WebMethod]
> [XmlInclude(typeof(Dog))]
> [SoapInclude(typeof(Dog))]
> public Animal getAnimal()
> {
>     return new Dog("brown");
> }
> public class Animal // ...
> public class Dog : Animal // ...
> Here is the XML contained in the response to the invocation of getAnimal(): the xsi:type="Dog" indicates that an instance of the daughter class is returned:
> <?xml version="1.0" encoding="utf-8"?>
> <Animal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="Dog" xmlns="http://tempuri.org/">
>   <species>Dog</species>
>   <color>brown</color>
> </Animal>
> And here is the client code, added to the auto-generated file obtained from 'wsdl2java -client':
> /**
>  * Client code
>  * Java
>  */
> org.tempuri.Dog dog = null;
> System.out.println("Invoking getAnimal...");
> org.tempuri.Animal animal = port.getAnimal();
> try {
>     dog = (Dog)animal;
> }
> catch (java.lang.ClassCastException e1) {
>     e1.printStackTrace();
> }
> if (dog != null) {
>     System.out.println("Color of dog: " + dog.color);
> }
> The trouble is that the cast from Animal (parent class) to Dog (daughter class) fails: a ClassCastException is thrown.
> Many thanks for any help on this issue,
>     _Olivier_

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-759) Inheritance deserialization problem

Posted by "Olivier Jacquemin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12511096 ] 

Olivier Jacquemin commented on CXF-759:
---------------------------------------

The problem also occurs with a CXF snapshot built from sources checked out this morning.

> Inheritance deserialization problem
> -----------------------------------
>
>                 Key: CXF-759
>                 URL: https://issues.apache.org/jira/browse/CXF-759
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0-RC
>         Environment: Win XP, .NET SOAP Web Service
>            Reporter: Olivier Jacquemin
>         Attachments: CxfInheritancePb.zip, CxfInheritancePb_070607.zip, ZooDump.zip
>
>
> I am currently in the process of selecting a mechanism for building a java client for a SOAP Web Services API developed in .NET.  This API is fairly simple, except for a point: some data structures returned are relatively complex and involve inheritance.
> In this case, these object structures don't seem to be correctly deserialized.
> A detailed description follows: if anyone could help me either
> - improving the deserialization process in Cxf, or
> - obtaining a way to access the raw XML data (or the corresponding parsed object structure) returned, so that the client application can complete the deserialization process itself in an "ad hoc" way,
> I would very much appreciate it.
> Here is a very simple example after reducing the problem to its simplest form.
> /**
>  * Web service code
>  * C#
>  */
> [WebMethod]
> [XmlInclude(typeof(Dog))]
> [SoapInclude(typeof(Dog))]
> public Animal getAnimal()
> {
>     return new Dog("brown");
> }
> public class Animal // ...
> public class Dog : Animal // ...
> Here is the XML contained in the response to the invocation of getAnimal(): the xsi:type="Dog" indicates that an instance of the daughter class is returned:
> <?xml version="1.0" encoding="utf-8"?>
> <Animal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="Dog" xmlns="http://tempuri.org/">
>   <species>Dog</species>
>   <color>brown</color>
> </Animal>
> And here is the client code, added to the auto-generated file obtained from 'wsdl2java -client':
> /**
>  * Client code
>  * Java
>  */
> org.tempuri.Dog dog = null;
> System.out.println("Invoking getAnimal...");
> org.tempuri.Animal animal = port.getAnimal();
> try {
>     dog = (Dog)animal;
> }
> catch (java.lang.ClassCastException e1) {
>     e1.printStackTrace();
> }
> if (dog != null) {
>     System.out.println("Color of dog: " + dog.color);
> }
> The trouble is that the cast from Animal (parent class) to Dog (daughter class) fails: a ClassCastException is thrown.
> Many thanks for any help on this issue,
>     _Olivier_

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-759) Inheritance deserialization problem

Posted by "Dan Diephouse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12511177 ] 

Dan Diephouse commented on CXF-759:
-----------------------------------

I'll look into this issue later today and see where I can get with it...

> Inheritance deserialization problem
> -----------------------------------
>
>                 Key: CXF-759
>                 URL: https://issues.apache.org/jira/browse/CXF-759
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0-RC
>         Environment: Win XP, .NET SOAP Web Service
>            Reporter: Olivier Jacquemin
>            Assignee: Dan Diephouse
>         Attachments: CxfInheritancePb.zip, CxfInheritancePb_070607.zip, ZooDump.zip
>
>
> I am currently in the process of selecting a mechanism for building a java client for a SOAP Web Services API developed in .NET.  This API is fairly simple, except for a point: some data structures returned are relatively complex and involve inheritance.
> In this case, these object structures don't seem to be correctly deserialized.
> A detailed description follows: if anyone could help me either
> - improving the deserialization process in Cxf, or
> - obtaining a way to access the raw XML data (or the corresponding parsed object structure) returned, so that the client application can complete the deserialization process itself in an "ad hoc" way,
> I would very much appreciate it.
> Here is a very simple example after reducing the problem to its simplest form.
> /**
>  * Web service code
>  * C#
>  */
> [WebMethod]
> [XmlInclude(typeof(Dog))]
> [SoapInclude(typeof(Dog))]
> public Animal getAnimal()
> {
>     return new Dog("brown");
> }
> public class Animal // ...
> public class Dog : Animal // ...
> Here is the XML contained in the response to the invocation of getAnimal(): the xsi:type="Dog" indicates that an instance of the daughter class is returned:
> <?xml version="1.0" encoding="utf-8"?>
> <Animal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="Dog" xmlns="http://tempuri.org/">
>   <species>Dog</species>
>   <color>brown</color>
> </Animal>
> And here is the client code, added to the auto-generated file obtained from 'wsdl2java -client':
> /**
>  * Client code
>  * Java
>  */
> org.tempuri.Dog dog = null;
> System.out.println("Invoking getAnimal...");
> org.tempuri.Animal animal = port.getAnimal();
> try {
>     dog = (Dog)animal;
> }
> catch (java.lang.ClassCastException e1) {
>     e1.printStackTrace();
> }
> if (dog != null) {
>     System.out.println("Color of dog: " + dog.color);
> }
> The trouble is that the cast from Animal (parent class) to Dog (daughter class) fails: a ClassCastException is thrown.
> Many thanks for any help on this issue,
>     _Olivier_

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-759) Inheritance deserialization problem

Posted by "Olivier Jacquemin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510224 ] 

Olivier Jacquemin commented on CXF-759:
---------------------------------------

Just tested with freshly released 2.0 version of Cxf (July 3, 2007): the problem still occurs.

> Inheritance deserialization problem
> -----------------------------------
>
>                 Key: CXF-759
>                 URL: https://issues.apache.org/jira/browse/CXF-759
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0-RC
>         Environment: Win XP, .NET SOAP Web Service
>            Reporter: Olivier Jacquemin
>         Attachments: CxfInheritancePb.zip
>
>
> I am currently in the process of selecting a mechanism for building a java client for a SOAP Web Services API developed in .NET.  This API is fairly simple, except for a point: some data structures returned are relatively complex and involve inheritance.
> In this case, these object structures don't seem to be correctly deserialized.
> A detailed description follows: if anyone could help me either
> - improving the deserialization process in Cxf, or
> - obtaining a way to access the raw XML data (or the corresponding parsed object structure) returned, so that the client application can complete the deserialization process itself in an "ad hoc" way,
> I would very much appreciate it.
> Here is a very simple example after reducing the problem to its simplest form.
> /**
>  * Web service code
>  * C#
>  */
> [WebMethod]
> [XmlInclude(typeof(Dog))]
> [SoapInclude(typeof(Dog))]
> public Animal getAnimal()
> {
>     return new Dog("brown");
> }
> public class Animal // ...
> public class Dog : Animal // ...
> Here is the XML contained in the response to the invocation of getAnimal(): the xsi:type="Dog" indicates that an instance of the daughter class is returned:
> <?xml version="1.0" encoding="utf-8"?>
> <Animal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="Dog" xmlns="http://tempuri.org/">
>   <species>Dog</species>
>   <color>brown</color>
> </Animal>
> And here is the client code, added to the auto-generated file obtained from 'wsdl2java -client':
> /**
>  * Client code
>  * Java
>  */
> org.tempuri.Dog dog = null;
> System.out.println("Invoking getAnimal...");
> org.tempuri.Animal animal = port.getAnimal();
> try {
>     dog = (Dog)animal;
> }
> catch (java.lang.ClassCastException e1) {
>     e1.printStackTrace();
> }
> if (dog != null) {
>     System.out.println("Color of dog: " + dog.color);
> }
> The trouble is that the cast from Animal (parent class) to Dog (daughter class) fails: a ClassCastException is thrown.
> Many thanks for any help on this issue,
>     _Olivier_

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-759) Inheritance deserialization problem

Posted by "Olivier Jacquemin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-759?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Jacquemin updated CXF-759:
----------------------------------

    Attachment: ZooDump.zip

Hi Daniel,

Here is a Wireshark dump corresponding to the source code sent previously, except that the client used the "ZooSoap" port instead of the "ZooSoap12" port.
ZooSoapClient.java, line 47: 
        ZooSoap port = ss.getZooSoap();

>From the dump, here is the response to the getAnimal() method invocation:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <getAnimalResponse xmlns="http://tempuri.org/">
      <getAnimalResult xsi:type="Dog">
        <species>Dog</species>
        <color>brown</color>
      </getAnimalResult>
    </getAnimalResponse>
  </soap:Body>
</soap:Envelope>

This is *very* similar to the one you used...
As I understand it, "trunk" means the current development branch: is this correct?  I'll try to get and compile the latest sources to see if this issue is fixed there.

> Inheritance deserialization problem
> -----------------------------------
>
>                 Key: CXF-759
>                 URL: https://issues.apache.org/jira/browse/CXF-759
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0-RC
>         Environment: Win XP, .NET SOAP Web Service
>            Reporter: Olivier Jacquemin
>         Attachments: CxfInheritancePb.zip, CxfInheritancePb_070607.zip, ZooDump.zip
>
>
> I am currently in the process of selecting a mechanism for building a java client for a SOAP Web Services API developed in .NET.  This API is fairly simple, except for a point: some data structures returned are relatively complex and involve inheritance.
> In this case, these object structures don't seem to be correctly deserialized.
> A detailed description follows: if anyone could help me either
> - improving the deserialization process in Cxf, or
> - obtaining a way to access the raw XML data (or the corresponding parsed object structure) returned, so that the client application can complete the deserialization process itself in an "ad hoc" way,
> I would very much appreciate it.
> Here is a very simple example after reducing the problem to its simplest form.
> /**
>  * Web service code
>  * C#
>  */
> [WebMethod]
> [XmlInclude(typeof(Dog))]
> [SoapInclude(typeof(Dog))]
> public Animal getAnimal()
> {
>     return new Dog("brown");
> }
> public class Animal // ...
> public class Dog : Animal // ...
> Here is the XML contained in the response to the invocation of getAnimal(): the xsi:type="Dog" indicates that an instance of the daughter class is returned:
> <?xml version="1.0" encoding="utf-8"?>
> <Animal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="Dog" xmlns="http://tempuri.org/">
>   <species>Dog</species>
>   <color>brown</color>
> </Animal>
> And here is the client code, added to the auto-generated file obtained from 'wsdl2java -client':
> /**
>  * Client code
>  * Java
>  */
> org.tempuri.Dog dog = null;
> System.out.println("Invoking getAnimal...");
> org.tempuri.Animal animal = port.getAnimal();
> try {
>     dog = (Dog)animal;
> }
> catch (java.lang.ClassCastException e1) {
>     e1.printStackTrace();
> }
> if (dog != null) {
>     System.out.println("Color of dog: " + dog.color);
> }
> The trouble is that the cast from Animal (parent class) to Dog (daughter class) fails: a ClassCastException is thrown.
> Many thanks for any help on this issue,
>     _Olivier_

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (CXF-759) Inheritance deserialization problem

Posted by "Dan Diephouse (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-759?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Diephouse reassigned CXF-759:
---------------------------------

    Assignee: Dan Diephouse

> Inheritance deserialization problem
> -----------------------------------
>
>                 Key: CXF-759
>                 URL: https://issues.apache.org/jira/browse/CXF-759
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0-RC
>         Environment: Win XP, .NET SOAP Web Service
>            Reporter: Olivier Jacquemin
>            Assignee: Dan Diephouse
>         Attachments: CxfInheritancePb.zip, CxfInheritancePb_070607.zip, ZooDump.zip
>
>
> I am currently in the process of selecting a mechanism for building a java client for a SOAP Web Services API developed in .NET.  This API is fairly simple, except for a point: some data structures returned are relatively complex and involve inheritance.
> In this case, these object structures don't seem to be correctly deserialized.
> A detailed description follows: if anyone could help me either
> - improving the deserialization process in Cxf, or
> - obtaining a way to access the raw XML data (or the corresponding parsed object structure) returned, so that the client application can complete the deserialization process itself in an "ad hoc" way,
> I would very much appreciate it.
> Here is a very simple example after reducing the problem to its simplest form.
> /**
>  * Web service code
>  * C#
>  */
> [WebMethod]
> [XmlInclude(typeof(Dog))]
> [SoapInclude(typeof(Dog))]
> public Animal getAnimal()
> {
>     return new Dog("brown");
> }
> public class Animal // ...
> public class Dog : Animal // ...
> Here is the XML contained in the response to the invocation of getAnimal(): the xsi:type="Dog" indicates that an instance of the daughter class is returned:
> <?xml version="1.0" encoding="utf-8"?>
> <Animal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="Dog" xmlns="http://tempuri.org/">
>   <species>Dog</species>
>   <color>brown</color>
> </Animal>
> And here is the client code, added to the auto-generated file obtained from 'wsdl2java -client':
> /**
>  * Client code
>  * Java
>  */
> org.tempuri.Dog dog = null;
> System.out.println("Invoking getAnimal...");
> org.tempuri.Animal animal = port.getAnimal();
> try {
>     dog = (Dog)animal;
> }
> catch (java.lang.ClassCastException e1) {
>     e1.printStackTrace();
> }
> if (dog != null) {
>     System.out.println("Color of dog: " + dog.color);
> }
> The trouble is that the cast from Animal (parent class) to Dog (daughter class) fails: a ClassCastException is thrown.
> Many thanks for any help on this issue,
>     _Olivier_

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.