Search code examples
javaweb-servicessoapwsdl

Generate WSDL dynamically


I have meta data that can be used to describe several hundred new web services and would like to dynamically create WSDL files from within my own Java class. I see many ways to do this when you have Java methods you want to expose as web services. Unfortunately that approach does not work for me as I have a single runtime method that can service many different operations and services. It's dynamic and as such does not have static classes that can be bound via map.xml. My plan is to generate WSDL files that will allow incoming SOAP envelopes to be received via HTTP POST, recognized, transformed and handled by my existing method.

This is to allow web service access is a 20 year old proprietary dynamically callable back end. I am certain that the meta data for each service can be easily presented to the outside world as web services and operations.

I could always write a custom builder by appending text to a StringBuilder but that least desirable choice. It would be far more reliable if there was an API I could use that would take in the essential items and attributes and when complete, validate and render a properly formed WSDL file.

I would like this to be generic and not require proprietary add on classes from others like what I might find in WebSphere.


Solution

  • In the end we built a WSDL generator using the .NET 4 System.Xml.Schema and System.Web.Services.Description namespaces. The generated WSDL is used in both Java and .NET to build client and server interface classes. It took a while but we have most of the services up and running, and they are totally platform agnostic.