You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Lars Kappenberg <hu...@gmx.de> on 2012/05/31 10:01:52 UTC

Axis2 WSDL2Java ADB complex type code reuse question

Hi all,

I would like to ask about how you are dealing with recurring complex types in WSDLs. In our case, I recieved a bunch of 10 WSDLs, all containing the same complex type, but the name of the complex type itself differs.

For example:

ServiceA:
    <complexType name="ServiceAAddress">
        <sequence>
             <element minOccurs="0" name="Street" nillable="true" type="string"/>
             <element minOccurs="0" name="City" nillable="true" type="string"/>
             <element minOccurs="0"
name="Country" nillable="true" type="string"/>
        </sequence>
    </complexType>


ServiceB:
    <complexType name="ServiceBAddress">
        <sequence>
             <element minOccurs="0" name="Street" nillable="true" type="string"/>
             <element minOccurs="0" name="City" nillable="true" type="string"/>
             <element minOccurs="0" name="Country" nillable="true" type="string"/>
        </sequence>
    </complexType>


If I generate the Java classes using wsdl2java -ss -sd -uri separate classes are generated (ServiceAAddress, ServiceBAddress located in different packages and so on).

Because of the different classes, reuse and casting is difficult. In our case, address can or IS always of the same type. I would like to have one piece of code to extract the address from any service (I have a dream :) ).


Thanks a lot for any hints.

Regards

Lars

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org