from my work as a developer
Archive for March, 2010
changelist
Mar 31st
I discovered nice future in my IntelliJ IDEA – Changelists!
What is that? It’s just grouping changed files in logical directory, see screen shot below:
As you can see under one name I can have many different files from different directories. And now comes the best part – you can manage them as the one!
Hit “Enter” on changelist title and all files will be opened in editor. I assigned special shortcut to change active changelist – “Shift + Enter”. And the last thing, you can commit the whole changelist at once, without specifying particular files, see command below:
svn commit --cl WW-3424 -m "Resolved WW-3424 - added expression evaluation for timezone attribute"
Happy Easter!
do it on client side
Mar 18th
This post is regarding my previous one about hacking Axis 2. I was asked to try to use Handlers instead of my brilliant hack! Easy to say
I was googling trying to find any example how-to do it on client side. There is a plenty numbers of examples for server side. In theory it should be easy – implement Handler interface and add it to particular phase in execution queue – easy? Yes! In practice not really
I wasn’t able to find any example how I should instruct Axis 2 client to use my handler. I found that I must create axis2.xml configuration file and put on class path, then Axis will auto-magically read that file and my handler will work! In practice it didn’t work, to inform Axis 2 base client that it should use that specific configuration I had to change the way how I was creating stubs.
URL resource = getClass().getClassLoader().getResource("axis2.xml");
ConfigurationContext configurationContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, resource.getPath());
MyClientStub myClient = new MyClientStub(configurationContext, "url://to.web.service");
I based my axis2.xml file on original one from main Axis 2 jar. I just removed classes that have been depending on JavaEE 5 (J2EE rulez!) to had everything up and running! I added my handler to OperationOutPhase phase – hopefully is the correct one
The funny thing was that each time I started my WebLogic server my start up environment just blown up! After stopping server I had to reinstall it to be able to rebuild a project
Anyway, my first approach got positive opinion and will be implemented! Uff… I could get rid of this whole Axis 2 custom configuration!
and the winner is
Mar 15th
Me!
Yep, I resolved that problem with Namespace optimization – basically I had to apply mentioned patch and upgrade Axiom to version 1.2.8. The error message I got previously was connected with old Axiom and they way how it was called from Axis 2. When you are using Axiom 1.2.7 you must change way how you are calling Axiom, see below – the second parameter has to be null (but this is the root of problems):
param.save(builder, null, xmlOptions);
Using original idea from patch is to call that method like this:
param.save(builder, builder, xmlOptions);
but you must using the latest Axiom version which is 1.2.8. Problem with that solution is that we are using home made dependency management tool and it isn’t so easy to hack central repo
Right now I’m looking into other solution – handlers! Axis 2 define a special way to connect your custom code with internal mechanisms, but it isn’t so clear for me how I could do that
a battle conitnues
Mar 12th
Another day I was fighting with Axis 2 and optimizing namespaces for Xml generated from XmlBeans – I mentioned that in my previous post. With help from a team mate I was able to introduce changes to how Axis 2 Ant task generating client’s web service stubs. I modified XSLT file used to do that – I was basing on existing issues with exactly the same problem. I followed the advice and changed XSLT template, added also some debug info and functionality do save results to file – to be sure I got what I wanted to get.
Everything went well, the first results were promising so I started an application to have a full test. And then I got such a problem:
WebService error: Invalid headers received: Attribute not allowed: v1 in element RequestorIdentity@http://technical.schemas.host.net/header/requestoridentity/v1, Attribute not allowed: v1 in element User@http://technical.schemas.host.net/header/caller/v1, Attribute not allowed: v11 in element User@http://technical.schemas.host.net/header/caller/v1, Attribute not allowed: v1 in element Applications@http://technical.schemas.host.net/header/application/v1
It looks like one of web services has some problems with optimized namespaces because the application is calling few other web services before I hit in the trouble with that one
So after two day I’m still in the same place!
axis 2 and xmlbeans, speed reading, msdn
Mar 10th
A new week and a new task!
Basically I must optimize XML requests that we are sending to our web services from application. We are using Axis 2 to build out our web service clients from WSDL files and as a data binding technology we are using XmlBeans. The whole task is to create instance of XmlOptions class and used it to serialize instances of defined XmlBeans documents. I’ve checked that with saving output to a file and it worked great, but … Clients based on Axis 2 are using dedicated class to serialize XmlBeans to XML structures. And it don’t care what you specify with XmlOptions
I’ve been trying to find some solution to omit that limitations – what I found was to try modify a XSLT file that is used to generate classes during parsing WSDL files. I expected it should be quite easy and should be the simplest possible solution to solve my problem, but … the classes are generated as I expected but what I noticed during testing that nothing changed – XMLs were still the same
The next idea is to build custom HttpServletFilter to catch whole response and parse it back to XmlBeans, optimize and serialize back to XML and send to web service – not so efficient way
I also started Speed reading course and my goal is to read 1000 words per minute! Right now I’m reading around 200 words per minute, so I have a lot of space to improve!
I forgot to mention that as a Apache committer I got a huge gift from Microsoft – a whole MSDN subscription package! Tones of tools, operating systems and other stuff! I need to find a way how to used them!
frozen zone
Mar 5th
We’re again in frozen zone – project is going to production
So I have a lot of spare time to improve my other skills, like learning GWT, studding books – Tony Buzan’s The Mind Set and so on.
I have a tricky question for you: why James Cameron made the Titanic ? Just watch his talk on TED and grab the answer
Another thing is GWT – sadly I discovered that not all widgets are presented with Widget Gallery, you have to look through API documentation to find them all – for example CaptionPanel
beautiful code
Mar 4th
Yesterday I had to help a younger team mate to solve a simple problem with persisting data with HTTP session. Case was quite simple but proposed solution wasn’t the best. We discussed other possibilities and found that what we had done is the best one for given circumstances. He did the work and has committed changes to source repository and then informed project architect.
As I said, solution wasn’t prefect but was the simplest one and easy to understand in the future when someone else who will take a care for the project. I took a look on the code and it was beautiful! Separated meaningful method name, named constants for String literals, null safe – beautiful! And all that was achieved without any comment from my side regarding how a code should looks like!

