Sunday, October 15, 2006

SWSDL - Simple WSDL format, and my swsdl2wsdl

Hand writing WSDL (Web Service Description Language, stop reading here if that doesn't mean much to you?) is a pain. The GUIs I have seen (whether XML Spy or Eclipse WTP or...) don't really change the fact that typing (or clicking, same thing) type and message and then a portType and then binding again and then finally a service... jeez!

Let's not go into the Contract First (writing WSDL and XSD) versus Code First (e.g. Java first and then generating WSDL and XSD from it) debate here. Let's assume you think doing SOA with Contract First makes sense, describing a service interface in XML Schema is sensible, but what bothers you too is having to write that WSDL, because you are lazy, and like me you think that might be a Good Thing.

Now, of course, there is WSDL 2.0 which promises some (!) simplification on the horizon, or maybe not (on the horizon even, or simplification)... whatever, it's not here today. Other ideas and tools which float around include e.g. WSCF (and jWSCF), but all I really wanted is a simple, platform/language-neutral form to describe a "service", referencing an XSD file for the Schema -like how hard is that? If "extensibility" is really needed, that "form" could allow extensions, but the normal most common use case should be simple.

So I designed SWSDL - Simple WSDL, a swsdl.xsd and a little converter (swsdl2wsdl) that generates WSDL 1.1 from my SWSDL. Here is a page where I compare hand-written SWSDL (Simple-WSDL) and the auto-generated standard WSDL by wsdl2swdl. Interested? Download swsdl-distribution-0.5.zip and give it a shot!

If you find this useful, let me know (post a comment on the blog) what you think. I might put this thingie on Sourceforge or Java.net or somewhere. For now, the src is in the swsdl-project-0.5.zip, but do try the swsdl-distribution-0.5.zip first as it has an example and launch script.

1 Comments:

Blogger Phil said...

Hello Michael

Although I try avoiding contract-first if possible, I agree that there are cases where contract-first is what is needed.
For those cases, I like the simple approach of SWSDL. I prefer particularly such a simple tool over a GUI-wizzard (such as jWSCF).

I do have a question: in the sample you provide, isn't there some magic? How does it know it has to generate a http binding? How does the tool know the URL of the service?

Are these things configurable? Or do you propose to change the generated code? How do you support round-trips (xml merger jumps to my mind, sorry for marketing ;-))?

BTW: I personally prefer a nicely designed website as typically found on sourceforge to the more spartanic (default?) view of java.net.

Cheers,
Philipp

18 October, 2006 17:48  

Post a Comment

<< Home