Wednesday, April 22, 2009

Nice WADL to HTML conversion

As a folloup to my previous post here is a blog posting about doing something similar for WADL.

Tuesday, April 21, 2009

Nice WSDL to HTML conversion

Whilst trying to help some one internally I can across this WSDL -> HTML converter (example with a google api). The cool thing is that you can download the XSLT file for use in your own build processes. Useful for automatically generating documentation. (Other tools are available; but many only work on the internal so no good for internal projects.)

I guess combined with the WSDL generation extension features in JAX-WS we could make things a bit prettier for ya basic JAX-WS services. Maybe if I get some time one day....

Some notes on why HATEOAS is good

Just a few notes on the experience of writing a RESTful API for the Sun Cloud component. A bit more commentary here on InfoQ.

Monday, April 20, 2009

Book Review: Processing XML documents with Oracle JDeveloper 11g

I don't normally review stuff on this blog but along with a bunch of other people in the oracle community I received a free copy of this book from Packt Publishing for review so I though why not as they asked nicely. You can find more on this book on the publishers website.

Now first of all will be the first to admit that I am probably not the accepted target audience for this book as it is targeted at beginner and intermediate developers so you have to take my personal perspective with a grain of salt. As a whole the parts of the book that focus on JDeveloper are fine and clear although there are some issues. The examples should use namespaces more as this is more relevant to the real world and in the xml diff chapter (10) totally ignores the functionality added to JDeveloper 11.

The book does given very brief introductions to various XML technologies although a beginner would be better served visiting XML Schools as there examples there provide a better introduction. I think these could have been trimmed from the book and more focus given to the code examples. I did think though that there should have been a section on XQuery if we are going to go down that route.

The main problem in this book are that many of the code samples unnecessarily make use of XDK classes directly. I can understand using the oracle implementation for performance reasons; but for the majority of the examples in this book this is just not necessary to use oracle classes to get this affect. As noted in the book the XML subsystems are plug-able and you only need to place the XDK on the class path for this to happen. For example in the XPath chapter the examples should be using javax.xml.xpath not casting to XMLDocument and using oracle specific APIs. In the XLST section rather than relying on the classloading mechanism to get the right transformer the author uses JXSAXTransformerFactory directly. And finally rather than using the oracle specific XMLPrintDriver to write out XML files the auther should be using the standard TranformerFactory.newTransformer().transform() identity transform to stream pattern. StAX also doesn't get a mention which is a shame in a modern XML Java book.

Even in chapters 7 and 8 which cover some interesting parts of the DOM 3.0 API for load / save and validation the author uses oracle specific classes rather the generic API that would achieve the same result. That being said these chapters did introduce some interesting ideas and concepts I had not come across.

Now there is some interesting stuff at the end about Apache-FO and Berkley XML DB which are worth a glance through. The JAXB section was disappointing as it contain no mention of mapping files, as someone with a fair bit of experience with web services I can tell you that you start to need them as soon as schemas become non-trivial. To be honest I was surprised there was so little mention of web services and SOA. The is a chapter on generating Excel spreadsheets from XML that was of some interest although it was more about writing lots of code to invoke a Excel generating library after parsing XML file than anything innovative.

So in summary if you want a good introduction to how to use the XML tooling in JDeveloper then this is a book to share; but not one you might life to read more than once. The main problem is that I couldn't in good faith give this book to a less experienced member of the team without a hefty health warning about the code issues, even then I would think twice. It is a shame really as I can see where this book was going and perhaps with some more directed editing it could be a valuable introduction.

Injecting Jersey Clients

I had to look this up for someone and it took me a little while so here is a link to a Paul Sandoz post about injecting Jersey API client. So this allow you to inject a client for a particular resource. Paul get bonus points for defaulting to the asynchronous form, in my opinion this should be the default for all web service clients....

TS-4993 Dealing with Asynchronicity in Java™ Technology-Based Web Services

Looks like we have a 10:50 slot on the thursday morning in room 134. This is the same location as last year with a capacity of around 1k people. Just need to finish writing the presentation and unpack my new laptop.

Going to be flying in at around 2pm Monday afternoon and taking the BART into town and my flight back out is on friday at 7pm. Staying at the Nikko which was nice if a bit pokey last year. Will take a look into making arrangement to meet up know my travel is schedule is being nailed down.

Generating the inferred deployment descriptors from annotations

The problem with annotation it that it is not possible to easily understand what is in a .jar/.war/.ear file. There is a little tool in weblogic appmerge that will generate the equivalent deployment descriptors. You simply use the -writeInferredDescriptors parameter.

java weblogic.appmerge -writeInferredDescriptors -output output.war input.war

Have to admit not played with it yet as I just picked this from an internal mailing list; but it seems like a good tip for corner cases.