Monday, July 17, 2006

WSDL Validation with wsdl4j

Imagine a set up where a team A provides Web Services to Team B. The service team A uses a "contract first" SOA approach, so they hand-write WSDL (more on that another time) and generate Java from it (not the other way around). Team A then implements these services using XFire as their SOAP stack. Now Team B takes these WSDL documents and generates client code from it, using Axis1.

Now WSDL being a standard format, this is a painless no-brainer, right? Right. Turns out Axis1 has a small but annoying bug which leads to it generating invalid Java code, which does not compile, from technically perfectly valid WSDL (if the 'name' of a <wsdl:message> used for a Fault has the same name as the actual <xsd:element> referenced by the <wsdl:part> in the <wsdl:message>). Easy to slightly adapt the original WSDL - once you have figured this out.

Of course, being "agile", I don't want this problem to come back haunting the team every so often, and thought about how to enforce/test the hand-written WSDL, which is perfectly valid technically, for this specific condition, during the automated build.

Turns out that thanks to JSR 110 & wsdl4j, this is pretty painless! The little WSDLValidationTask for ant (download WSDLValidationTask.java source) that I ended up hacking together is used like this:

<taskdef name="wsdl-validation" classname="wsdlvalidation.wsdl.WSDLValidationTask" />
<wsdl-validation>
<wsdl dir="wsdldir" includes="my.wsdl" />
</wsdl-validation>

2 Comments:

Anonymous Anonymous said...

cheap wow gold
mp3 player
mp4 player
sell wow gold
cheap mp3 players
mp3 player
wow gold
zubehoer mp3 player
best mp3 player
eve isk
mp4 players
mp3 mp4 player
buy eve isk
1BG MP3 PLAYER
2BG MP3 PLAYER
baladeur MP3
baladeurs MP3
cheapest wow gold
mp3 player
mp4 player
guild wars gold
wow powerleveling guide
world of warcraft gold
cheap world of warcraft gold

23 May, 2008 04:41  
OpenID technical-tejash said...

Nice article

12 November, 2009 14:08  

Post a Comment

Links to this post:

Create a Link

<< Home