This was a day long tutorial, given by Adrian Trenaman about how to create WSDL defined web service, using either either a SOAP, JMX or plain XML payload.
Adrian Trenaman works for Iona, which is a SOA consulting company. Iona have developed a framework on top of Apache CXF, called Fuse Service Framework. This is totally open source and Iona make money by providing service contracts, consultancy and training courses. This is the perfect example of where a company can make money by providing the core service for free.
Adrian was a softly spoken Irishman who had obviously given this course many times before in a much larger form. He wasted no time in working out what we could achieve in one day, helped us very quickly set up eclipse, and bombarded us with a massive amount of information.
Fuse SF, is a framework that allows you to create web services, either as a server or a client. A web service is something that a server provides via either HTTP or the Java Messaging Service (JMS). The service is defined via a WSDL document, which is a sort of mix between XSD and a basic XML document. In this document there is a definition of a port, which defines how this service can be accessed - i.e. its payload. Normally this is defined as a SOAP payload, which is a definition of a method call, and its return values in XML, wrapped up in a SOAP envelope.
With all these definitions, it seems that this would take a lot of work to actually create one of these services, there is certainly a lot of XSD definitions, XML marshaling and un-marshaling etc going on, on both the client and the server. Fuse FS makes this very easy. You can create a service either by creating an annotated java interface and implementation, or generating everything you need from the WSDL document. It works a bit like magic. Once I had my system configured correctly, I could create a simple service (one method call, one return) in about half an hour. This was very easy to test, because Fuse could also generate a client as well. A more interesting idea, would be to create a client in say Ruby, and then try to interact with the java server - which is the whole point of having a Service Oriented Architecture (SOA).
This was all very interesting and was a great advert for Fuse but what came later was much more significant. Fuse can be used to create a RESTful web service. Restful is now a big thing in the web world. The original idea came from Roy Fielding's Phd Thesis, and it has gone from strength to strength.
From a web service point of view, no WSDL is used, and all service operations are defined via HTTP URLs. The same URL can be used with different HTTP verbs (POST, GET, PUT and DELETE) to do different things. A URL with a DELETE verb would delete something, while GET would retrieve the same information. The other key idea is that there is no idea of a session between requests. All of that information will have to be passed via the URL. This is not a really really new - its functional programming at another level.
If you change the annotations on your Java interface and implementation, then Fuse will generate the other components you need to provide your service as a set of URLs. The payload could be simple XML. This service could also be sent to a web bowser, if the returning data was in the form of JSON- Java Script Object Notation.
If you compare the two ways of providing a web service, the RESTful idea seems a lot easier to handle on the client. We then, unfortunately, ran out of time, which was disappointing, but we did have to go home. I was happy that I took this course because I got to program and I got to learn something new.
If you think about it, Fuse is simply an implementation of model driven development, which is used to generate all the boring bits of web services automatically. I could imagine how much more boring it would be to generate such a service by hand and it is also something that the Spring-Hibernate people could learn from.