views:

13

answers:

1

I need to consume two .NET webservices in NetBeans. I am using the METRO 2 library to generate the client code.

These web services (webservice 1 and webservice 2) are from the same provider and when I have both of them in the same project their generated code shares the same namespace. The problem is that the ObjectFactory class is overwritten by the most recently refreshed webservice node.

For example: if I refresh the client node for webservice 1, calls to it work fine, but calls to webservice 2 result in a a "Unable to create JAXB Context" exception. If I then refresh webservice 2 calls to it will work, but calls to webservice 1 will cause the exception.

In an effort to get around this issue, I created a new library project (WebService1) and moved webservice 1 into there. I then reference the WebService1 jar in a second project (WebService2) which has a client node for webservice 2. The problem now is that when I run WebService2 the wsit-client.xml from WebService1 is loaded, which obviously doesn't have references to webservice 2. In this scenario, calls to webservice 1 always work and calls to webservice 2 always fail (with a JAXB context exception).

Is there any way to use separate wsit-client.xml files, or a way to use both services in the same project?