I have several (let them say, 2, A and B) webservices, and I need to create a client to use their togheter. In Netbeans, I use the "new web service client" wizard to submit two wsdl, looking at the Netbeans weekend, just call wsimport for each of them.
wsimport http:/mydomain/wsA.svc?wsdl wsimport http:/mydomain/wsB.svc?wsdl
Both A and B generate the same package com.mydomain.myapp (I assume they are defined in the same namespace), so I get a set of stub classes A and B combined into the same package.
However, wsimport also creates an ObjectFactory for each web service, so if I create a stub B after A, I get only the ObjectFactory associated with the definitions of B (because the first, A, is overwritten). Conversely, ObjectFactory of A is preserved if I switch the order.
The problem is that I need both ObjectFactories to create JAXBElements wrapper shell instances for web service types A and B.
Is there a way to map the namespace for A in the java package and B in another to get
com.mydomain.myapp.a com.mydomain.myapp.b
and so keep both ObjectFactories?
Simple refactoring does not help, because internally getClass () is called as soon as the package has been reorganized, it no longer works.
source share