BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

Article: "Code First" Web Services Reconsidered

| by Stefan Tilkov on Aug 27, 2007. Estimated reading time: less than one minute |
The most common approach to web services development is to start from code, and generate an XML Schema and WSDL definition. Most web service advocates consider this "wrong", the reason being that this often leads to interoperability problems and a very tight couping between implementation and interface artifacts. Instead, they argue one should start with a WSDL file, and then generate implementation code – possibly for different consumer and provider frameworks.

In a new InfoQ article, Dennis Sosnoski questions this conventional wisdom, and explains that most of the problems with the code-first (or "start-from-code approach, as he calls it) are rooted in the first generation tooling. He shows how the JiBX framework can be used to  practice start-from-code development without incurring the disadvantages, specifically without coupling implementation and interface too tightly.

See the article for more information.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

wow, a pragmatic approach to web services? by Jeff Payne

Great article! Regardless of ones view point on the whole wsdl-fist vs code-first debate, one has to admit that sometimes it's just much more practical to start with the interface in code, especially if it's already been written and needs to be exposed as a service. Plus, I much rather deal with a generated WSDL a few times in the lifetime of a project than deal with generated source code day in and day out.

One thing that Dennis doesn't mention is reuse. I seems like it would be a lot easier to reuse source code designed by the developer and not generated by a tool.

Re: wow, a pragmatic approach to web services? by anjan bacchu

Hi There,

I am working on a "CONTRACT FIRST or WSDL first" project and find that the generated classes don't have an equals or hashcode generated for them. It would be nice if I could somehow get the WEBLOGIC 9.2 java code generator to do something like that.

BR,
~A

Re: wow, a pragmatic approach to web services? by Rajbir Grewal

Good point of view, I would also like to mention XmlBean binding also.This can be used for Document/Letral style web services. While working on web service on both BEA Workshop and Rational Developer
I would say its much more easer to develop code first web service using document style in BEA workshop. RSA is more geared towards RPC/literal style. It would be nice if RSA can in corporate XmlBean binding (java2wsdl)in there WSDL generation from code. Using WSDL first (Contract first) approach is little complex and complexity will increase as we try to expose more operations in WSDL.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

3 Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date with curated articles from top InfoQ editors

"You dont know what you dont know" change that by browsing what our editors pick for you.

BT