I am looking for a possibility to convert two Axis Datatypes (generated by WSDL2Java) into each other. Both DataTypes consists of exactly the same Attributes because they are both from the same XSD.
The Problem is Axis generates them as Seperated Datatypes.
DataType1:
public static class AbstractAsynchronousResponse extends AbstractResponse implements org.apache.axis2.databinding.ADBBean {
/*
* This type was generated from the piece of schema that had name =
* AbstractAsynchronousResponse Namespace URI =
* http://www.example.org/AllCallbackTypes Namespace Prefix = ns2
*/
.........}
DataType2:
public static class AbstractAsynchronousResponse extends AbstractResponse implements org.apache.axis2.databinding.ADBBean {
/*
* This type was generated from the piece of schema that had name =
* AbstractAsynchronousResponse Namespace URI =
* http://www.example.org/AllCallbackTypes Namespace Prefix = ns2
*/
.........}
Now I want to do Something like this:
AbstractAsynchronousResponse1 response1 = new AbstractAsynchronousResponse1();
AbstractAsynchronousResponse2 response2 = (AbstractAsynchronousResponse2) response1;
Is there a solution?
Here is a Method I created to solve this Problem. However this isn’t really nice but it works.