As you've noted, the databinding classes (MyTransaction
and so on) are being generated as inner classes of the stub classes. So each stub has its own copy of the MyTransaction
class which isn't compatible with the other one.
The wsdl2java parameter -u
will cause the databinding classes to be generated as regular classes, each in its own file. If the two MyTransaction
definitions are actually identical, then wsdl2java would generate the same class file for each of the MyTransaction
objects, and you'd be able to share MyTransaction
objects between the two services.
This page describes the wsdl2java parameters in detail.