I have a java noob question regarding class casting.
A few schemas were created in eclipse to define certain types. One of the types i will talk about is Address. A WSDL was created from these schemas and built into a package. From this, the main IMPL class was created which are the WSDL stub calls that the client will use to retrieve information. I have no control over the client other than the fact that it knows what functions are available and thats all the client knows about. It doesnt know nor is it supposed to know anything about the server side.
the WSDL Address class is something like:
An example of one of the functions created from the WSDL would be a certain function:
where the com.general.client.Address is what it expects to be returned back.
My Converter class is supposed to act as a bridge between client and server so that the server code never changes in the future, if any new functions are added to the schemas or if new schemas are created, thus new wsdl's. Converter, in this case, will use the argument 'id' and use that number to do whatever it needs to do to get the correct data that i need, in this case, it is an Address..that represents my own Address class( that i created with a different package name).
Because its my own definition of Address(with the same attributes) its going to have a different package name. Remember though that the IMPL class expects to be returned its own Address type(com.general.client.Address) and my Address class type is in the form of something like com.general.server.Address. So now I have address information based on the ID that i passed to my Converter constructor but that information is stored in my own Address class type. I need to use my converter class to take my own internal Address Class type and convert this back to the original IMPL class address type, because that's what it expects.
So in my converter class how, would i make the appropriate java method calls or casting class to convert my Address class type to the correct IMPL Address class type that it expects?