Wednesday, March 23, 2011

Java programming nowadays

A colleague hit a problem yesterday while testing in isolation a SCA (Service Component Architecture) component. He was trying to call WSDL method from a Java SCA component using a SCA reference. In this case you actually obtain an implementation of a generic interface, and on this interface you have to use a generic invoke that looks like this:
java.lang.Object invoke(java.lang.String operationName, java.lang.Object input);

In the case the WSDL method you try to invoke has one parameter then you just pass an object (SDO - Service Data Object in fact) of that type to the invoke method, we had such a case and it worked. But what do you in case the WSDL method has 2 or more parameters? Initially we guessed that the input would be an array of objects, but it didn't work (wrong number of arguments exception) and if you think carefully it would be ambiguous to have an array of objects because one cannot distinguish if the invoke should have as many parameters as the number of objects from the array, or just one parameter (array of objects). At this point we were stuck.

So what do you do when you get stuck? You search on Google: for the exception, or a part of the stack trace, add a few keywords that you think are relevant like the application server you are using (WebSphere Process Server 7.0), framework and technology names (SCA, SDO, WSDL, Java, invocation) and the like. Sometimes you get the answer immediately if someone else hit earlier the same problem and posted the solution on a blog or a forum, but this time it was not that easy. I had to search for about 45 minutes, try all kind of keywords, read forums, blogs and help pages until I finally found the solution in a sample in some documentation manual from IBM. You basically have to use the SCA API and create a special wrapper SDO that contains all the input parameters as properties and then pass this object to the invoke method. You can read the full solution here if you are interested :)

Sunday, March 20, 2011

The tennis connection

I'm watching the men's final at Indian Wells masters series tournament between Nadal and Djokovic. After a disputed point the TV camera turned to a cheering spectator, Larry Ellison, the CEO of Oracle, who happens to be the owner of the tournament since a few years ago. Is this some business intelligence in a relational database or something? :)

P.S. Vamos Rafa!

Some fine Romanian music

First it's the song of a band heard by chance on TV tonight. I looked them up on the net and here they are, TiPtiL (the case is strange even for a Java programmer :), I use camel case usually, so I would write tipTil for a variable) with a jazzy alternative rock that in a song ("Spune-mi!") reminds me even of Alexandru Andries. And two female voices that complement each other very nice in some parts. I found only on Trilulilu their song that I liked most:

TiPtiL - Hai!

Asculta mai multe audio punk

The other band it's Toulouse Lautrec. I heard it before on the radio (they are qualified as Romanian indie rock), but this song I found tonight is infectious: