Skip to content

Java template for WSDL-first web services using CXF (for Maven2 and Eclipse)

This took me a while to put together so I thought I’d post it. I wanted the simplest possible template for building a web service in Java. I wanted it to be JAX-WS compliant, so I used the CXF open source implementation which is not only compliant, but also flexible and fast. I also wanted the template to be WSDL first, meaning that I should be able to edit the WSDL by hand to maintain total control over the service contract, then from that, generate Java code to make it easy to fill in the implementation.  (I consider that to be an important part of web service best practices. Doing it the other way - automatically generating WSDL from code - is simpler, but results in messy, sometimes incorrect WSDL that limits your ability to change web service implementations later.) Furthermore, I didn’t want to edit any generated code. I wanted to be able to fill in the implementation details by inheriting from a generated class or implementing a generated interface. Finally, I wanted to take advantage of Maven to build the project, but also be able to work on it in Eclipse, taking advantage of its Web Tools Platform (WTP) to allow synchronization with a live application server. Here’s the result in just under 300 lines of code. (Or you can cut to the chase and just download the zip file and follow the instructions at the end of this posting.)
Continue reading ›

Tagged , , , ,

A maze of twisty little Java web service standards, all alike

It’s almost impossible to keep up with all the fractal-like Java standards related to web services. As fast as each can be learned, Sun invents another, and a dozen open source implementations appear. For my own sanity I tried to create a rough map of some of them. I tried to avoid making recommendations; my main objective was to sketch out how they fit together. I also focused on the open source options; there are many good commercial implementations of all of these too.
Continue reading ›

Tagged , ,

Is Eclipse collapsing under its own weight?

Maybe Eclipse’s black-hole-like splash screen is more appropriate than its designers realize. Eclipse’s open architecture has enabled the creation of countless useful plugins, and that’s helped maintain its position as the leading Java IDE. But as plugins compound upon plugins, bugs and compatibility issues have been surfacing increasingly frequently, and I’m starting to get the sense the Eclipse developers have lost control.
Continue reading ›

Tomato: An antioxidant for your router

Every few months my Linksys WRT54G V4 home wireless router stops working and nothing short of a full reset gets it going again. This weekend it happened again. I got fed up and started Googling. I found out I’m not the only one to suffer from this problem. But then I found out that in 2003 Linksys, under pressure to comply with the GPL, released the router firmware and immediately afterward people started coming out of the woodwork improving it. (Doesn’t anyone have better things to do with their time?) Seriously, this has to be one of the best open source success stories ever. Some open-source variations of the firmware provide more features, giving this $60 router functionality similar to a $600 router. Others allow you to boost the RF signal. Still others provide a simplified and improved user interface. Most allow SSH or Telnet access to the router’s Linux kernel. All of them reportedly improve its reliability. I researched several of these and tried DD-WRT for a few hours. It’s very powerful and I was almost sold, but then I discovered Tomato. It’s perfect and I’m never going back.
Continue reading ›

Tagged , , ,

Orange lines

A few evenings ago I looked out of my kitchen window and saw an airplane’s vapor trail in the sunset - a beautiful, bright, clean, orange line cutting through the clouds. At that moment I had brief but unmistakable feeling of optimism about the human race.
Continue reading ›

Slimmer, trimmer messaging from Google

Google’s Protocol Buffers offer lightweight, language-independent object serialization. I love the design, especially as I’m increasingly seeing enterprise networks clogged with hordes of oversized XML messages. Protocol buffer bindings are available for C++, Java, and Python, but not C# yet. Once there is support for .NET, I think this could be a really interesting technology for financial applications.

Developing Web applications with Maven and Eclipse: You *can* have it all

When developing applications using Eclipse or a similar IDE, you quickly get used to being able to test your software immediately after making a change. Plugins like MyEclipseIDE enable that kind of instant edit/compile/test cycle for web applications as well.

But if you’re building web applications with Maven, it’s not so easy. Maven is a fantastic tool for building applications and managing dependencies, but it lends itself to a more batch-oriented mode of operation in which you build and deploy war files from the command line. I found myself wishing I could have the best of both worlds; building my web applications using Maven, but with a seamless edit/compile/test cycle when using Eclipse. Then I discovered the WTP (Web Tools Platform) project. Hallelujah!
Continue reading ›

A virtuous pairing

I ran across the following comments on an El Reg article about virtualization: Comments about “Virtualization: Nothing New”.

He’s right, isn’t he? Having the same company offer both virtualization and grid solutions is a truly virtuous pairing. First you tell people they need a grid solution to make a huge pool of computers look like a single one, then after it’s all set up you sell them virtualization software. It’s beautiful. It’s like if, for example, Nestle and Jenny Craig got together to simultaneously offer chocolate products and dieting solutions. Oh wait, they did: Nestle to buy Jenny Craig.
Continue reading ›

My new favorite ISP

My new favorite web hosting provider is A Small Orange. Their pricing is competitive, and their tech support is unbelievably quick and clueful.

Understanding Java5 Generics

Good article on Java5 Generics by Martin Wolf:

http://blogs.infosupport.com/martinw/articles/generics.aspx

It seems many programmers are confused about generics, in particular the use of the ? extends ... notation. The question mark is called a type wildcard, and is typically used as the value of a type parameter in a generic method. It means that wherever the method is invoked in your code, the compiler infers a specific type to be substituted for the wildcard and enforces that at compile time. The notation ? extends X is a bounded wildcard, meaning that the deduced type must be a subtype of X. Here’s a variation on Wolf’s example which I think might help clarify the difference.
Continue reading ›