views:

204

answers:

1

I have a few JAX-WS web services hosted on the same server. They use the same entity objects, but when the web services are consumed by a client, the reflected entity objects are always different between the web services.

How do I force all the clients to identify the entity objects to be of the same data type across multiple web services?

i.e.

webservice.Student class for web service StudentAdministration and webservice.Student class for web service ClassAdministration

are both different objects in the consumer's point of view. How do I change my web service to expose the webservice.Student class to let the consumer know that both are the same entity types, even though they are exposed from different web services?

A: 

You need to define the common entities in a single XML schema as described here:

https://jax-ws.dev.java.net/guide/Compiling_multiple_WSDLs_that_share_a_common_schema.html

Nick Holt
In that case, is it possible to do anything on the web service side that can cause the consumer's generated classes to be the same across the number of web services?I thought that the last post in http://forums.java.net/jive/thread.jspa?threadID=28673 is relevant to what I want to do, but I don't really understand how I'm going to include the 2 files the author states inside ant
pkchukiss
The way this should work is the the WSDL for each service should reference the same schema. When you generate the stubs for each service (from the WSDL) identical classes will be generated based on the common schema. These identical classes can then be shared by each consumer. Does that make sense or have I missed something?
Nick Holt