Jax-WS Glassfish XSD :? Xsd = 1 vs? Xsd = 2

I am absolutely sure that I am missing something simple here.

I use netbeans to create the web service jax-ws and the client in two separate projects, and I have some user bindings that I added to the client using the interface in net beans. It all seems to work fine, but from time to time after changing the service and redistributing the xsd location, it seems to change from /ServiceName?xsd=1 to /ServiceName?xsd=2 , which stops my user bindings.

I can simply configure the bind files that have worked the last several times, but the last time some content remains in ?xsd=1 is the definition for stringArray , which seems to cause an error when I try to update the client. Here is the error I get:

Two classes have the same XML type name "{ http://jaxb.dev.java.net/array } stringArray". Use @ XmlType.name and @ XmlType.namespace to give them different names.

Any suggestions would be greatly appreciated!

+4
source share
1 answer

Well. No, you did not miss anything. You have chosen the wrong one to achieve what you want to achieve (at least in my experience).

You are using the “first Java approach” (at least as I interpreted your question). It might be useful to use the WSDL-first strategy:

  • Take the created WSDL documents and save them as an authorization WSDL (add the .wsdl and .xsd files to your project).

  • Use wsimport to create server and client stubs.

  • Make future changes for WSDL / XSD files only and create a wsimport task to create new stubs.

  • The WSDL server created by the server uses only WSDL files (now manually supported).

Direct editing of WSDL files seems more tedious, but more promising evidence. You have more control over the generated objects, and also you get a better idea of ​​compatible or incompatible changes in your API.

+1
source

All Articles