I have two services: Service1 and Service2. I have a class that methods in both services accept and return: CommonClass. These classes are in one package.
If I use Java2WSDL to produce .wsdl files for both services, Service1 puts CommonClass in its namespace, and Service2 puts CommonClass in its namespace. However, the code in the version of CommonClass generated by WSDL2Java tags it as belonging to Service2. I'm getting an InvocationTargetException when I deploy and run a test, and I'm assuming that's because Service1 is returning a CommonClass belonging to Service1's namespace, but that conflicts with the metadata in CommonClass tagging it as belonging to Service2's namespace. There might be another reason for the exception, but in any case that's something I'd like to correct. So, I created a .wsdl file putting CommonClass in its own namespace not having anything to do with Service1 or Service2, then I used the "-I" switch to Java2WSDL to import that into the WSDL for Service1. It did import it, but it also added CommonClass in the type section a second time as belonging to Service1's namespace. 1. Is creating a separate namespace as described above the correct way to deal with things like this, and 2. Is there a way to get Java2WSDL to automatically output what I need, or do I need to edit these files by hand?