Posts tagged axis

do it on client side

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.

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

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):

Using original idea from patch is to call that method like this:

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

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:

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

A new week and a new task!Men's Club – Онлайн Журнал

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!

Go to Top