wood burning stoves 2.0*
The moose likes Web Services and the fly likes Multi WebService Clients Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Multi WebService Clients" Watch "Multi WebService Clients" New topic

Multi WebService Clients

Mat Anthony
Ranch Hand

Joined: May 21, 2008
Posts: 232
I'm currently using spring web services with jaxb. I have created a single endpoint containing my operations and a single xsd schema.
If I have two different clients:-
Client A requires operation 1, 4, 5
Client B requires operations 1, 3
Then how do I provide unique wsdls for each client, so that they both have the agreed contract?
Do I create two different xsd schemas and enpoints?


Meghana Reddy
Ranch Hand

Joined: Jan 29, 2002
Posts: 76
If your web service is not serving specific data for specific clients, you can use one WSDL which avoids duplication of logic and you can host only one web service.

But if your web service is specific to a client then it is better to have two separate WSDLs to avoid maintenance problems later in the future.

Meghana Reddy
Mat Anthony
Ranch Hand

Joined: May 21, 2008
Posts: 232
Hi Meghana,
thanks for the reply. I think I have got it working, but I'm not sure if I have done the correct architecture.
I have created specific schemas to cover specific tasks (example:- createOrder, checkCredit, checkSupplier etc)
For each of the schemas, I created an endpoint containing all of the specific operations. I used anntotation to ref the
data structure objects defined in the scheams used by the operations. For each client that had a specific contract I created
a unique schema that included in the the other schemas that I required (i.e. chechCredit & createOrder). This approach looks like
it works. Since I'm using spring ws +jaxb the schemas automatically create the wsdls that I can publish. My only question is
that inside the generated wsdl it defines different operation names than the ones that I have created within my endpoints.
Can you somehow specify the operation names that you want in the wsdl?
Sorry about the question, but i'm new to spring ws with jaxb.

Meghana Reddy
Ranch Hand

Joined: Jan 29, 2002
Posts: 76
I do not know if there's a way to customize the operation names while generating the WSDL in Spring. I've customized the namespace to package names mapping.
But you can manually edit the WSDL and change the names which is a tedious task(atleast to me) and in general,
it is not a good practice to play around with generated stuff because your maintenance will become a hassle.
I wouldn't do that unless absolutely needed.
I agree. Here's the link: http://aspose.com/file-tools
subject: Multi WebService Clients
Similar Threads
JAXB: Two xsd - Create single JAXBContext
client server programming which supports both TCP and UDP
Different Message Exchange Pattern interfaces
OO vs Procedural?
Can we have more than one WSDL file for same service