Monday, December 3, 2007

Narrowing down the problem

Steve Loughran has commented on my previous post, thanks. One thing I'd like to clarify that what I was trying to do is not to push back on the criticism of WSDL per se, but to actually narrow down the problem a bit.

If one takes a WSDL document and runs a wsdltojava tool of some sort against it then the link between this WSDL doc and a generated type is obvious. Now, lets try to reverse-engineer it a bit. Suppose we have a generated Customer type which probably relies on some JAXB mechanics, how do we know which description language was used to generate it in the first place ? It may've been generated from WADL, and it's a REST client library which might be depending on it, which I believe was something Steve was describing in his original email. The point I'm trying to make is that while a description language like WSDL makes it easy to do the code generation, IMHO WSDL in itself is the not the only party to blame so to say...

About Ant vs Maven. I personally still like Ant because I know it better. And by comparing Ant vs Maven and REST vs WS* debates, the only thing I wanted to say that when proponents of competing technologies/approaches discuss pros and cons of their technologies of choice their arguments seem somewhat familiar :-) And yes, I agree, the build scenario Steve described is easier to do with Ant.

3 comments:

steve_l said...

Sergey, if you look at my paper criticising JAX-WS, a lot of the problems are really related to XSD, not WSDL. The problem is the combination produces the worst IDL ever invented in terms of readability and writeability by humans. It goes out of its way to discourage you from writing them, and it increases the risk that you have errors because they are so non-obvious.

I dont know if RelaxNG+WSDL2 would be better, but it could hardly be worse.

Sergey Beryozkin said...

RelaxNG+WSDL2 or may be RelaxNG+WADL, this is something which I'll be looking into quite soon

steve_l said...

-RelaxNG + WADL would be interesting, but I'm still of the belief that if you remove the ability to handle arbitrary XML, or adapt to more data coming in.

If you look at Ant in Action, I do some XML to Java code generation, but only creating constants. Because I think that copying element names into XPaths is a different form of brittleness...