Why is Java Web Services so Hard?

buy cheap doxycycline online cheapest synthroid prices xanax without prescription cheap prozac tablets cheap tramadol acomplia zithromax pharmacy tramadol without a prescription phentermine pills buy generic accutane where to buy cialis cheap zoloft online doxycycline prices cheap generic phentermine nexium online cheap cheap synthroid tablets acomplia online nexium pills buy cheap propecia buy plavix buy diazepam without prescription accutane online stores accutane cheap cheap generic viagra clomid without prescription cheap plavix buy bactrim without prescription tramadol online phentermine without prescription buy synthroid diazepam online stores discount diazepam nexium online stores bactrim online stores order diazepam purchase lasix online purchase lorazepam bactrim prescription buy cheap tramadol zithromax online cheap acomplia generic phentermine plavix for sale cheap plavix tablets cheap tramadol tablets pharmacy lasix lasix sale pharmacy diazepam buy doxycycline accutane prices buy cheap phentermine lasix prices buy cheap nexium synthroid for sale plavix discount buy doxycycline cheap lowest price alprazolam cheap lorazepam online nexium cheap cheap generic cialis discount propecia pharmacy prozac soma discount soma online buy generic flagyl discount nexium cheapest tramadol prices discount viagra levitra generic buy accutane cheap synthroid pharmacy where to buy phentermine acomplia pills viagra sale bactrim pharmacy buy accutane without prescription lowest price acomplia buy lorazepam cheap buy phentermine without prescription diazepam for sale cheapest clomid valium prices buy prozac online tramadol sale clomid online synthroid cheap cheap alprazolam online order soma online buy zithromax phentermine no prescription where to buy lorazepam accutane online where to buy bactrim propecia cheap cheapest valium prices pharmacy lorazepam bactrim for sale price of soma buy cialis order bactrim online lorazepam without prescription zoloft without prescription lowest price diazepam pharmacy clomid cheap propecia buy levitra cheap purchase soma online purchase prozac order zithromax valium no prescription valium prozac prices nexium generic zoloft cheap cheap generic prozac order doxycycline online diazepam pills levitra accutane no prescription buy lorazepam tramadol prices online doxycycline where to buy synthroid buy alprazolam online alprazolam prescription zoloft buy cheap flagyl online zithromax pills online valium acomplia cheap plavix pills cheap zithromax online levitra online stores lorazepam pills order flagyl online doxycycline prescription cheap lorazepam buy acomplia discount acomplia cheapest prozac prices alprazolam without a prescription online synthroid cheap phentermine tablets alprazolam order clomid online cheapest diazepam prices zoloft for sale viagra pharmacy buy cheap lorazepam online clomid online cheap pharmacy tramadol buy cheap soma purchase clomid online cheap doxycycline purchase prozac online purchase cialis flagyl prescription diazepam prices viagra online stores accutane prozac pharmacy bactrim generic buy zoloft without prescription lowest price flagyl clomid pills buy clomid online cialis pharmacy pharmacy phentermine price of clomid buy acomplia online price of prozac phentermine online tramadol buy lasix online levitra without prescription buy cheap xanax online cheapest propecia prices cheapest acomplia prices buy lorazepam online cheap generic xanax accutane without a prescription synthroid without prescription order plavix flagyl without a prescription buy generic clomid lowest price lorazepam order soma order zoloft online propecia sale synthroid discount pharmacy cialis price of lasix prozac pills tramadol without prescription valium pharmacy purchase zoloft online buy cheap lorazepam accutane for sale lowest price clomid levitra no prescription synthroid sale nexium prices lowest price nexium generic lorazepam purchase synthroid xanax online cheap purchase bactrim cheapest alprazolam synthroid generic cheap xanax cheap generic acomplia buy cheap lasix online accutane pharmacy alprazolam pills cheap valium online lowest price cialis plavix generic buy levitra online tramadol online stores buy cheap nexium online zithromax lorazepam online stores acomplia no prescription lorazepam cheap bactrim no prescription buy plavix online lasix generic purchase clomid buy cheap zoloft online buy generic xanax doxycycline online cheap lorazepam online cheap cialis online cheap zithromax for sale generic lasix cheapest synthroid generic nexium purchase phentermine online prozac generic order prozac online clomid prices where to buy tramadol price of phentermine phentermine prescription lowest price propecia cialis online stores discount plavix cheap diazepam soma generic cheapest viagra prices cheapest bactrim prices buy cheap flagyl lorazepam pharmacy buy diazepam online propecia discount buy valium buy zithromax without prescription buy generic tramadol order levitra valium discount nexium online discount doxycycline bactrim cheap propecia prices plavix prices online nexium clomid generic synthroid buy cheap prozac online lasix online stores buy cheap valium online cheap xanax tablets xanax without a prescription buy soma online cheap phentermine online where to buy prozac where to buy alprazolam buy cheap plavix online order phentermine generic clomid buy tramadol cheap prozac cheap propecia tablets generic xanax purchase zithromax levitra online purchase viagra propecia generic generic synthroid buy cheap alprazolam online where to buy propecia acomplia without prescription cheapest diazepam order lorazepam xanax discount where to buy zithromax cheap diazepam tablets price of cialis cheap generic lasix order flagyl buy clomid without prescription diazepam online cheap order accutane zithromax without prescription doxycycline cheap lasix online cheap cheapest plavix alprazolam online buy cheap clomid online buy generic zithromax levitra for sale buy cheap acomplia doxycycline online stores purchase flagyl online nexium generic plavix pharmacy nexium price of alprazolam purchase nexium online buy generic cialis cheap flagyl tablets buy cheap bactrim online buy alprazolam cheap soma sale buy generic synthroid phentermine sale plavix pharmacy buy viagra online xanax purchase cialis online pharmacy flagyl alprazolam no prescription cheapest bactrim buy cialis online clomid sale flagyl online stores tramadol pills propecia online cheap lowest price tramadol cheap valium tablets price of viagra clomid no prescription synthroid pills order doxycycline nexium sale order cialis price of zithromax buy nexium cheap alprazolam for sale discount valium buy generic acomplia generic tramadol plavix without a prescription online clomid cheapest lorazepam prices lasix without a prescription order levitra online cheap cialis online online soma cialis no prescription buy propecia zoloft discount lowest price lasix cheap prozac phentermine generic cheapest levitra levitra pharmacy clomid pharmacy bactrim prices acomplia online cheap where to buy diazepam cheap generic levitra accutane sale tramadol discount cheapest doxycycline purchase acomplia online accutane online cheap cheap generic tramadol price of bactrim order lorazepam online order xanax online purchase levitra flagyl online valium for sale cialis plavix sale cheap levitra tablets price of zoloft purchase viagra online cheap generic zoloft flagyl discount prozac prescription soma pharmacy propecia order propecia online price of flagyl online levitra price of doxycycline bactrim propecia without a prescription acomplia prescription order synthroid zoloft online cheap flagyl sale buy synthroid cheap buy lasix without prescription zoloft without a prescription alprazolam sale buy tramadol without prescription prozac without a prescription flagyl generic buy propecia online cialis prices purchase lasix cheapest nexium purchase diazepam buy lorazepam without prescription buy cialis cheap lorazepam no prescription where to buy accutane xanax online zithromax discount prozac discount synthroid prescription lowest price bactrim discount zithromax accutane generic buy generic bactrim order valium online buy generic lorazepam cheap generic flagyl where to buy zoloft purchase accutane online discount phentermine plavix cheap zithromax cheap cheap generic lorazepam viagra cheap xanax online purchase bactrim online generic valium propecia online stores flagyl pharmacy lowest price valium buy synthroid without prescription cheap viagra online buy cheap lasix cheap doxycycline tablets levitra cheap online alprazolam diazepam pharmacy cheapest nexium prices purchase acomplia xanax pharmacy propecia pharmacy cheap accutane online valium without prescription cheap alprazolam purchase propecia purchase diazepam online cheapest phentermine prices generic zoloft order tramadol clomid online stores plavix no prescription price of synthroid cheap generic propecia cheapest tramadol order alprazolam online buy alprazolam without prescription buy cheap cialis discount levitra where to buy valium cheap prozac online cheap generic soma lorazepam generic buy flagyl cheap price of propecia lowest price soma order acomplia online lowest price viagra buy doxycycline without prescription cheap zithromax tablets flagyl no prescription diazepam without a prescription cheap levitra online prozac online cheap levitra without a prescription buy generic doxycycline buy prozac cheap phentermine for sale buy bactrim cheap pharmacy zithromax cheapest flagyl where to buy flagyl acomplia online stores buy lasix cheap buy cheap propecia online cheap soma cheapest accutane prices pharmacy alprazolam lasix pharmacy cheap zithromax viagra prescription zithromax without a prescription online accutane cheap lasix online acomplia generic cheap flagyl cheap clomid tablets order lasix online cheapest alprazolam prices buy nexium buy cheap clomid synthroid without a prescription accutane pills buy clomid diazepam sale bactrim sale lorazepam cheap doxycycline online valium pills buy soma cheap buy lasix phentermine online stores buy synthroid online online lorazepam lasix no prescription buy generic propecia xanax for sale cheapest zoloft prices buy phentermine cheap plavix online cheap bactrim cheap viagra tablets viagra without prescription cheap generic diazepam buy zoloft cheap order accutane online cheapest soma prices clomid cheap viagra prices phentermine cheap nexium pharmacy discount synthroid lorazepam prices buy xanax flagyl cheap cheap generic doxycycline buy cheap levitra prozac no prescription buy zithromax cheap discount lasix discount tramadol prozac without prescription discount cialis cheap lasix soma prices online phentermine buy propecia without prescription cheap diazepam online online diazepam plavix online cheap order bactrim where to buy soma cheapest xanax prices buy cheap xanax xanax prices cheap clomid online prozac online lowest price zithromax online bactrim cheapest cialis valium online stores synthroid online stores zoloft prices generic acomplia xanax cheap diazepam discount viagra online purchase tramadol online valium without a prescription order zithromax online doxycycline no prescription tramadol clomid for sale pharmacy soma viagra discount synthroid online cheap purchase propecia online viagra online cheap cheap valium cialis without a prescription discount prozac lasix online levitra online cheap cheap soma online buy levitra without prescription buy flagyl online buy cheap zithromax online acomplia discount where to buy plavix cheapest soma soma online cheap nexium without a prescription purchase alprazolam zoloft online tramadol no prescription cheap phentermine online cialis zoloft online stores phentermine online lasix pills valium sale cheap bactrim online clomid prescription generic viagra levitra pills purchase xanax online buy bactrim pharmacy plavix buy cheap diazepam accutane prescription buy cheap diazepam online buy nexium online cheap lorazepam tablets cheap alprazolam tablets price of valium buy cheap synthroid online discount bactrim lasix without prescription generic alprazolam flagyl without prescription online xanax viagra no prescription generic zithromax levitra prices generic cialis buy cheap phentermine online buy clomid cheap buy xanax cheap cialis online buy generic viagra doxycycline discount order clomid online propecia cheap plavix online purchase valium online cheap zoloft generic propecia lorazepam discount buy cheap soma online buy cheap prozac phentermine prices xanax pills online prozac prozac online stores acomplia pharmacy acomplia prices buy viagra lowest price doxycycline cheap acomplia online cheapest levitra prices buy cheap doxycycline buy cheap tramadol online propecia prescription zithromax generic buy tramadol price of plavix lowest price phentermine prozac sale buy alprazolam cheap generic clomid cheapest accutane discount soma purchase synthroid online buy generic plavix doxycycline generic purchase plavix xanax prescription valium generic bactrim online cheap purchase lorazepam online buy xanax online alprazolam online stores price of acomplia zoloft prescription soma pills generic levitra cheap synthroid discount zoloft alprazolam pharmacy viagra cheap cheap accutane cheap generic bactrim buy phentermine online buy flagyl buy levitra cheapest acomplia buy generic phentermine price of tramadol buy cheap zithromax cheap lasix tablets buy plavix cheap nexium discount tramadol pharmacy purchase accutane phentermine online cheap buy cheap acomplia online cialis cheap lasix for sale cheap flagyl online nexium no prescription cheapest lasix prices pharmacy xanax buy tramadol online alprazolam without prescription buy zithromax online order nexium viagra generic buy generic valium where to buy acomplia acomplia without a prescription buy cheap viagra pharmacy levitra order phentermine online buy flagyl without prescription buy accutane buy cheap alprazolam purchase zithromax online lowest price prozac lowest price accutane doxycycline sale bactrim without a prescription alprazolam online cheap cheap generic zithromax pharmacy bactrim levitra discount cheapest plavix prices buy cheap synthroid purchase doxycycline online buy cialis without prescription generic bactrim buy zoloft online synthroid prices propecia online cheap acomplia tablets buy cheap zoloft doxycycline pharmacy cheapest prozac cheap viagra cheap nexium online price of diazepam cheap generic plavix cialis prescription xanax online stores soma prescription plavix without prescription soma for sale lowest price zoloft cheapest zithromax prices cheapest zithromax buy generic alprazolam lorazepam for sale alprazolam generic cialis for sale cheap tramadol online cheapest cialis prices synthroid online order tramadol online buy viagra without prescription order viagra online zithromax no prescription order plavix online flagyl pills cheap cialis tablets cheap clomid diazepam generic buy generic nexium purchase alprazolam online flagyl propecia pills viagra without a prescription propecia for sale cheap cialis flagyl for sale prozac cheap diazepam without prescription zoloft sale order viagra accutane discount doxycycline for sale valium prescription lorazepam online bactrim discount cheapest valium order zoloft alprazolam cheap zoloft generic buy prozac without prescription purchase phentermine online lasix online flagyl cheapest propecia lorazepam sale order synthroid online valium online cheap purchase doxycycline cialis discount lowest price plavix purchase xanax zithromax prices pharmacy propecia buy prozac doxycycline cheap generic synthroid purchase tramadol pharmacy viagra cheapest xanax soma cheap generic accutane soma no prescription order lasix price of nexium buy valium without prescription buy cheap accutane xanax generic doxycycline without a prescription buy cheap levitra online synthroid no prescription cheapest phentermine valium online buy generic levitra cheapest doxycycline prices prozac for sale plavix online stores purchase levitra online lorazepam without a prescription zithromax online stores lasix prescription buy cheap cialis online buy valium online pharmacy zoloft pharmacy doxycycline price of accutane cheapest clomid prices clomid without a prescription valium cheap acomplia sale bactrim without prescription zoloft pharmacy levitra prescription tramadol cheap buy viagra cheap cheapest zoloft buy soma cheap propecia online flagyl online cheap cheap generic alprazolam cheapest lorazepam buy diazepam purchase soma soma without a prescription buy generic diazepam buy cheap viagra online cheap levitra cheap generic valium purchase zoloft order prozac plavix zoloft no prescription discount xanax pharmacy valium clomid discount cheap accutane tablets accutane without prescription soma without prescription soma cheap propecia no prescription propecia without prescription zithromax prescription pharmacy accutane cheapest viagra buy bactrim online diazepam cheap order acomplia buy generic zoloft order valium cheap soma tablets xanax sale buy generic soma viagra for sale cheap zoloft tablets lorazepam prescription diazepam prescription price of xanax nexium without prescription order diazepam online discount flagyl where to buy lasix pharmacy synthroid cheap nexium tablets buy cheap valium generic prozac buy xanax without prescription zithromax sale cheapest lasix bactrim pills lasix where to buy xanax diazepam online order xanax doxycycline pills purchase nexium phentermine pharmacy cialis pills buy doxycycline online buy soma without prescription lowest price levitra clomid alprazolam discount buy phentermine buy generic lasix buy acomplia without prescription cheap bactrim tablets discount lorazepam zithromax online cheap buy diazepam cheap generic soma order propecia generic diazepam order nexium online tramadol online cheap purchase plavix online lasix discount online viagra alprazolam prices phentermine discount where to buy levitra acomplia for sale soma online stores buy cheap bactrim bactrim online price of levitra generic accutane buy cheap accutane online order cialis online nexium for sale where to buy nexium price of lorazepam buy propecia cheap doxycycline online levitra sale cheap nexium cheapest flagyl prices cialis without prescription buy nexium without prescription discount accutane where to buy viagra zoloft pills where to buy doxycycline tramadol for sale buy zoloft tramadol generic cialis sale where to buy clomid online zoloft cheap synthroid online buy accutane online nexium prescription purchase flagyl flagyl prices buy generic prozac discount alprazolam diazepam no prescription buy cheap plavix viagra pills phentermine without a prescription buy valium cheap generic flagyl cialis generic online zithromax cheap generic nexium doxycycline without prescription lasix cheap online plavix buy plavix without prescription generic doxycycline plavix prescription buy acomplia cheap diazepam xanax no prescription discount clomid purchase valium online acomplia lowest price xanax tramadol prescription pharmacy acomplia lowest price synthroid order alprazolam

This is an excerpt from my book: SOA Using Java Web Services.

If you are a Java developer building enterprise applications today, chances are you are looking at how to best use the Web Services standards built into Java EE 5 to create systems using Service-Oriented Architecture (SOA) principles. These standards include JAX-WS 2.0 (formerly JAX-RPC 1.1) [JSR 224], JAXB 2.0 [JSR 222], Web Services Metadata 2.0 (WS-Metadata) [JSR 181], and Web Services for Java EE 1.2 (WSEE) [JSR 109]. I call these standards, taken together, Java EE 5 Web Services (JavaEE5-WS).

SOA applications are constructed from loosely-coupled Web services. So, naturally, as Enterprise Java developers, we turn to the JavaEE5-WS specifications as our tools for creating SOA applications. Furthermore, the leading Enterprise Java vendors hold out JavaEE5-WS technologies as the development platform of choice for SOA applications.

So, the JavaEE5-WS standards are very important. They are the foundation for SOA. And loosely-coupled SOA applications are critical to corporate competitiveness because they enable business processes to be flexible and adapt to rapidly changing global markets.

Unfortunately, if you are like me, you have found JavaEE5-WS complex and difficult to work with. There often seems to be lots of complex machinery required just to deploy a Java class as a Web Service or create a simple client to consume such services. Sure, you can get the simple “Hello World” application from the Java EE 5 tutorial working. But when you need to deploy your purchase ordering system, things suddenly get a lot more complicated. Either the WSDL you start with gets compiled into a myriad of bizarre classes that have to be manually wrapped and mapped into your real purchasing system. Or, if you start from your Java classes, the WSDL that gets produced doesn’t turn out the way you need it to. If you have run into these problems, then I sympathize with you. So have I, and that is what motivated me to write this book.

Am I Stupid or is Java Web Services Really Hard?

At first, I just thought I was stupid. Prior to getting involved with Java Web Services, I had been running a consulting business. I figured that since I’d been a manager for the past several years, the technologist side of my brain had atrophied. “Keep working at it!”, I said to myself, “and you’ll master this stuff.”. That was 3 years ago, and I’m still struggling to figure out how to best make use of the Enterprise Java standards for Web Services.

During those past 3 years, I’ve mastered topics such as Java generics, reflection, and EJBs. I’ve studied the Apache Axis [AXIS, AXIS2] source code – and even submitted a few patches. I’ve convinced myself that I’m not stupid. Yet, I’m still struggling to develop an intuitive understanding of these complex standards. And I’m not alone.

Richard Monson-Haefel, a distinguished technologist, published a 960 page book on the J2EE 1.4 versions of these Java Web Services specifications in late 2003. 960 pages! That is all the evidence anybody needs to prove that this stuff really is complex. Its not that any one particular topic is all that difficult. Sure, it takes a little while to figure out what the JAX-WS API does – for example. But, the real difficulty is getting your mind around all these APIs and how they relate to the underlying Web Services standards (e.g., XML, WSDL, and SOAP), the HTTP protocol, and the other Java EE container services (e.g., dependency injection). This complexity can make working with the JavaEE5-WS standards feel awkward and unnatural.

During the past two years, there has been a growing chorus of leading technologists - Monson-Haefel among them - bashing the Enterprise Java Web Services standards. And I agree that it is very difficult to do useful SOA-style application development work with the J2EE 1.4 versions of the Java Web Services standards. But, I have trouble agreeing that the specifications themselves are the real problem. Instead, I suspect that the problem itself – creating a general purpose framework for Web Services development – is just plain complicated.

Richard Monson-Haefel posted this email on his blog on April 22, 2006. It summarizes pretty well how a lot of us feel after having spent a lot of time working on Java Web Services:

Dave Podnar’s 5 Stages of Dealing with Web Services

  1. Denial - It’s Simple Object Access Protocol, right?
  2. Over Involvement - OK, I’ll read the SOAP, WSDL, WS-I BP, JAX-RPC, SAAJ, JAX-P,… specs. next, I’ll check the Wiki and finally follow an example showing service and client sides.
  3. Anger - I can’t believe those #$%&*@s made it so difficult!
  4. Guilt - Everyone is using Web Services, it must be me, I must be missing something.
  5. Acceptance - It is what it is, Web Services aren’t simple or easy.

One thesis of this book, simply stated, is that Web Services are hard. We need to accept that fact and move on. Web Services are hard because they are a form of distributed computing and distributed computing is just about the hardest problem in computer science.

Don’t Drink That Kool-Aid

In early 2001, when Ariba, IBM, and Microsoft published WSDL 1.1 as a W3C Note, Web Services were envisioned as a way make distributed computing easier. No longer would developers need to understand CORBA to create cross-platform, distributed applications. Even better, Web Services were envisioned as a technology to make distributed computing over the Internet possible.

Like me, most Java developers bought into this early Web Services vision. It made sense given our experience with the Internet during the 1990s. HTML over HTTP had fueled the astonishing growth of the World Wide Web – a distributed computing platform for people. We believed that standards (like SOAP and WSDL) for XML over HTTP would fuel similar growth for Web Services – a distributed computing platform for business applications.

We all drank that Kool-Aid. We believed that Web Services would make distributed computing easy.

The leaders of the Enterprise Java industry set to work implementing the Web Services vision. Along the way to realizing this vision, the Java industry discovered that they had created some pretty daunting specifications. The people who read the JAX-WS, JAXB, and other Enterprise Java Web Services specifications – including myself – got alarmed. We figured that something must have gone wrong. We assumed that the Expert Groups leading these specifications had gotten off-track. We got disillusioned and bitter about the lost promise of Web Services. We started bickering amongst ourselves about SOAP vs. REST and who is to blame for the complexity of the Java Web Services specifications.

But the complexity problem doesn’t result of choosing the SOAP framework instead of REST. It’s not a result of over-engineering on the part of the Expert Groups. As the Expert Groups got down to brass tacks – trying to make the Web Services vision happen – they rediscovered that distributed computing really is a daunting challenge. SOAP, WSDL, XML, and even REST, are not going to make distributed computing easy.

Certainly the Enterprise Java specifications for Web Services are flawed. But that is to be expected – new technologies always come with mistakes (look at EJB). The mistakes get corrected and flushed out with subsequent versions [1].

As one example of how the Enterprise Java specifications have improved, consider JAX-WS 2.0. Chapters 6 and 7 describe that specification in detail, so for now, I’m just going to give a preview of why I think it’s such a big improvement over JAX-RPC 1.1. For starters, the JAX-RPC data binding has been removed and the specification has been simplified to focus entirely on the WSDL to Java mapping. The XML Schema to Java data binding from JAX-RPC has been eliminated and the data binding features in Java EE 5 are provided by JAXB 2.0. Second, JAX-WS lets you use annotations to control the shape of the WSDL generated from a Java interface. The use of annotations in this manner simplifies and in some cases eliminates the need for the deployment descriptors required to deploy a JAX-RPC service. Third, JAX-WS provides interfaces (Dispatch on the client side, and Provider on the server side) that enable programmers to directly access and work with XML – effectively bypassing the JAXB data binding when they don’t want to use it. For certain, JAX-WS 2.0 could still be improved greatly. The biggest improvement that I can think of would be to provide an alternative binding (in addition to JAXB) that lets the developer work directly the native XML types that are specified in a WSDL and its associated schema. Some type of XML extension to the Java like XJ [XJ] might do the job. Much of the complexity and confusion that developers experience when working with JAX-WS relates to the difficulty of determining how the JAX-WS / JAXB generated classes created by the JAX-WS WSDL compiler map to the XML messages specified in the WSDL. But, that is a whole research area (creating a language that makes it simple to program directly with native XML types) unto itself where we are all still waiting for some breakthroughs. My point here is not that JAX-WS is ideal, but simply that is has improved on JAX-RPC much as EJB 3.0 has improved on EJB 2.1.

To summarize, in the years since the WSDL specification came out, the Enterprise Java community has created from scratch a Java-centric platform for distributed computing based on Web Services technologies. This has been a Herculean task and it shouldn’t surprise anyone that the specifications are difficult to understand! Viewed from this perspective, the JavaEE5-WS standards are not bad at all. In fact, they are a huge step forward toward enabling Enterprise Java to become a SOA development platform. These standards give us the APIs that we need to wrestle with the complexities of Web Services development.

So why are we disillusioned? What lesson should we be learning as we wallow in our disillusionment? I think it is the same lesson that we learn over and over again in this business – “Don’t drink the Kool-Aid”! If we didn’t start out by assuming that Web Services was going to be a silver bullet for distributed computing, we wouldn’t be disillusioned. Instead, we would be optimistic.

Round Pegs and Square Holes - Application Frameworks vs. Toolsets

Realizing that Web Services are intrinsically difficult forced me to rethink my assumptions about the JavaEE5-WS specifications. I no longer believed that these specifications could be significantly simplified. I accepted their complexity as the natural expression of the complexity of the underlying distributed computing problem.

Instead of viewing JavaEE5-WS as an application framework for SOA-style development, I recognized it as a toolset for distributed computing. My problem had not been stupidity, but using the tools incorrectly. Trying to create SOA applications with the JavaEE5-WS technologies is like trying to pound a square peg in a round hole. JavaEE5-WS is not an application framework.

Application frameworks make programming easier by encouraging application development along the lines of a particular architecture. For example, the Apache Struts [STRUTS] framework encourages the applications based on the Model 2 or Model View Controller (MVC) framework. Frameworks offer a layer of abstraction on top of complex toolsets. The layer of abstraction encourages you to program in a certain way. By restricting your programming choices to a sub-set of proven patterns, the framework makes your job easier and less confusing.

Application frameworks can also encourage good design. For example, in Chapter 4, I discuss the use of centralized XML Schema libraries as a mechanism to promote separation of concerns. Such libraries separate the type definition process (a necessary part of creating SOA application with Web Services) from the interface definition process (i.e., creating WSDL representations of individual SOA components). A good SOA framework, therefore, should encourage the use of XML Schema libraries and promote the reuse of schema across WSDL documents.

Application frameworks employ toolsets, but they go beyond toolsets. They encourage a particular manner of using toolsets. Struts, for example, employs Servlets and JavaServer Pages (JSP) among other toolsets. On top of these toolsets, Struts provides a framework of classes (e.g., Action, ActionMapping) for building applications according to the MVC framework.

Thinking through the Struts analogy to Web Services, I realized that JavaEE5-WS provides a toolset but not an application framework. To develop SOA business applications, I really wanted an application framework like Struts - not just the underlying toolset.

Along these lines, I started to think that a useful SOA application framework could be created on a foundation analogous to the ActionMapping and Action classes from Struts. In Struts, an ActionMapping maps an HTTP request to an Action instance that encapsulates calls to the appropriate business logic and dispatches the response to the appropriate View. Likewise, I thought, a SOA application framework could have a customizable Controller layer that receives SOAP messages and dispatches them to the appropriate implementation class. In this approach, the WSDL representation can be thought of as the View (using the MVC analogy), and the Java classes that implement the WSDL are the Model. One current limitation with the JavaEE5-WS toolset that hampers the implementation of this approach is that this dispatching process (analogous to the Controller) is difficult, if not impossible, for the programmer to manipulate. That is because it is hard-wired to correspond to the WSDL to Java mapping defined by JAX-WS. What control the programmer has over dispatching comes through annotations which are embedded in the target Java classes themselves. The JavaEE5-WS design is analogous taking the ActionMapping (Controller) and embedding it in the business logic (Model).

Don’t worry if this analogy to Struts seems confusing at this point. Chapters 9 – 11 explore the concept of a Java application framework for SOA in detail. And you don’t have to be a Struts programmer to understand it. At this point, I just want to give you a flavor for where I’m headed with the application framework idea.

The good news is that, by implementing the JavaEE5-WS toolset, the Enterprise Java vendors have done a great deal of hard work that paves the way for the development of application frameworks for SOA. One just has to get a little clever to work around some of the JavasEE5-WS limitations when attempting to create a SOA application framework.

Epiphany

Understanding the need for SOA application frameworks built on top of the JavaEE5-WS toolset was my epiphany. Instead of trying to create SOA applications using JavaEE5-WS, I began to think about how to create an application framework for SOA.

The result is contained in the last three chapters of this book – an effort to show how application frameworks for SOA can be created using JavaEE5-WS.

Before discussing either the JavaEE5-WS toolset APIs, or how to implement a SOA application framework on top of it, I need to introduce some common terminology in order to discuss the different components of a platform, like Java EE 5 Web Services, or Apache Axis, that enables the development and deployment of Web services. I call such a system a Web Services platform. The next section introduces what I call the Web Services Platform Architecture (WSPA), which provides the common terminology that is used throughout this book for discussing Web Services platforms. Think of the WSPA as our reference architecture. As we discuss Java EE 5 Web Services, we will refer back to the WSPA to discuss its strengths and weaknesses.


 


[1] Note that EJB 3.0 continues to improve and implements advanced Aspect Oriented Programming and Inversion of Control features that its many detractors have been calling for.

6 Responses to “Why is Java Web Services so Hard?”

  1. SCJWSD says:

    Thank you for clearing my painful points about Java Web Services. It is not so easy like you said.

    I have been waited for Head First Java Web Services. Head First make my life easier. :)

  2. bv says:

    Headfirst is good to understand the concepts. i feel it has very limited details for day to day programming..

  3. Matt G. Madhavan says:

    Thank God! I am not stupid!

    Great article and summarizes all the pain, agony, self doubt, exhilarations etc I went through dealing with web-services over the years!

    Thanks
    Matt

  4. Dhanalakshmi says:

    Hi,

    I would like to create a web application which has front end as JSP+ Struts framewrok and it should call a web service. But I am not able to call that webservice which I’ve created from the stub class into Action class.

    If you have any sample code with you please send it me either the link to download or send it to me my email Id as given

  5. Mark says:

    Try posting your question on one of the java.net forums related to JSPs or Web Services. See http://forums.java.net/jive/index.jspa

  6. Nick says:

    Microsoft’s Web Services on .NET is so easy to use? Is there are Koolaid factor here ?

    I would like to know if anyone here can contrast java vs microsoft web services.

    Thx

Leave a Reply

You must be logged in to post a comment.