Reputation: 1368
I'm perfectly sure I'm missing something simple here.
I'm using netbeans to create a web jax-ws web service and a client in two separate projects, and I have some custom bindings that I've added to the client using the interface in net beans. This all seems to work fine, but every once in a while after making a change to the service and redeploying the location of the xsd seems to change from /ServiceName?xsd=1
to /ServiceName?xsd=2
which stops my custom bindings working.
I can just adjust my binding files, which has worked the last few times, but the last time some content remains within ?xsd=1
- this is a definition for stringArray
, which seems to be causing an error when I try to refresh the client. Here's the error I'm getting :
Two classes have the same XML type name "{http://jaxb.dev.java.net/array}stringArray". Use @XmlType.name and @XmlType.namespace to assign different names to them.
Any suggestions will be very greatly appreciated!
Upvotes: 4
Views: 1052
Reputation: 146
Well. No you are not really missing anything. The aproach you chose is not perfect for what you want to achieve (in my experience at least).
You are using a "Java first" approach (at least that's how I interpreted your question). It might be helpful to use a WSDL-first strategy:
Take your generated WSDL documents and save them as the authorative WSDL (add the .wsdl and .xsd files to your project).
Use wsimport
to generate the server and client stubs.
Make future changes only to the WSDL/XSD files and have the wsimport
task generate the new stubs.
ingore the server generated WSDL and only use the (now manually maintained) WSDL files.
Directly editing the WSDL files seems more tedious but is more future proof. You have more control over the generated entities and also you get a better feeling for compatible vs. incompatible changes to your API.
Upvotes: 1