views:

116

answers:

2

We are using "Bottom Up" approach for building webservices. We have 10 java classes which we want to expose as a webservice. How can we create only one WSDL file for these classes? (java2wsdl utility & its ANT TASK takes only one class as parameter for generating WSDL file.)

A: 

I am not sure if you will find any tool which could take multiple java classes and generate one WSDL for them. You could generate WSDLs for each service and then combine them manually by copying the relevany vomplex types and service operations in 1 WSDL and then your SOAP servlet could identify these operations and call relevant service classes.

I hope someone can tell a cleaner approach for this as the one I am suggesting is definitely not the best way.

Fazal
A: 

Definitely not the right way of doing it, by default all the tools assume they are exposing a single service.

There is one thing you can try if you are using Jax-WS(Metro or Axis2 or CXF) try creating a interface and let all these classes implement that interface and all the methods (operations) you want expose as part of the web service, and use @WebService with this interface as the value of "endpointInterface".

shivaspk