Improvement in Axis2 JAXWS implementation

Few days back when I was trying to secure an Axis2 JAXWS service, I found a serious issue in the current JAXWS implementation in Axis2 trunk. Basically a JAXWS services can’t be used with any module which involves policies (ex: security) at all. This is because the WSDL of a JAXWS service doesn’t show the policies engaged in the service. This scenario is omitted thinking that a JAXWS service is not used with policies as it is only an annotated java class. But policies can be included and modules can be engaged into any service programatically. In such cases this is a serious issue.

For normal Axis2 services, WSDL is generated by looking at the AixsService object which contains everything about the service. In the current JAXWS implementation, WSDL is generated through a separate WSDLSupplier. It doesn’t use the AxisService object at all. This is why the policies are not shown in the generated WSDL. If someone programatically adds a policy into a JAXWS service, this policy is not shown in the WSDL when ?wsdl is called. Therefore a client won’t be able to invoke this service.

In JAXWS service deployment, there are 2 cases
1. buildAxisServiceFromWSDL
2. buildAxisServiceFromAnnotations

In case 1, AxisService is built using WSDL11ToAxisServiceBuilder. Therefore in this case, WSDL can be generated in the normal way without using this WSDLSupplier. But in case 2, AxisService object doesn’t contain a schema in it and the WSDL can’t be generated in the normal way. That’s why this WSDLSupplier is used.

In order to fix this issue in case 2, I’ve generated the WSDL from this WSDLSupplier in the deployment time and then used the WSDL11ToAxisServiceBuilder to build the AxisService. Therefore we don’t want this WSDLSupplier (when ?wsdl is called) in both the above cases and policies are shown in the WSDL properly.

I’ve added a parameter into axis2.xml as “useGeneratedWSDLinJAXWS”. By default it is false and the behavior is exactly as it was before this fix. If it is set to true, this new behavior is turned on and the WSDLSupplier is not registered. WSDL is generated in the normal way by looking at the AxisService object. Therefore, if someone needs to add policies into a JAXWS service, this behaviour can be used.

I created a JIRA for this and attached the patch last week and committed it into trunk yesterday. Now the fix is available in trunk.

Advertisements

Indian Cricket at its Peak

Who will win the 2011 Cricket world cup? This has become an extremely hot topic among millions of Cricket lovers around the world. I feel like it is INDIA. There are several reasons to support that feeling.

First of all I think after a long time they have found a fantastic captain in Mahendra Singh Dhoni. He is a cool character who can perfectly handle pressure situations. He was known as a hard hitting batsman with very little patience. But how well he has adapted to the captain’s role. I’ve seen him playing in extremely pressure situations with loads of responsibility as a captain and winning close games for India.

Second reason is the current form of the Indian team. They beat Sri Lanka in Sri Lanka 4-1 recently. It’s a very well known fact that beating Sri Lanka in our own soil is not too easy. Currently Indians are playing with New Zealand and today’s game was a rain of boundaries and sixes for Indians. Little master Sachin is back in prime form, has scored 163. What a batting line up they have got these days. Sehwag, Sachin, Yuvraj, Dhoni etc. all are in brilliant form. I think they have won 12 out of last 13 ODIs. It seems like this form will continue for a long time.

sachin dhoniyuvraj1

Next reason is that the 2011 world cup will be held in Asia. As playing in Pakistan is uncertain due to terror attacks, most of the matches will be played in India. It’s a huge bonus for the Indians to play on their own soil in front of their own crowd.

Finally the Aussies who dominated ODI cricket for about 10 years, are showing a lack of consistency these days. Specially with the huge loss on their own soil against South Africa.

I think All these facts shows an Indian win. But I know that cricket is a very unpredictable game. In fact my best wish goes to our Sri Lankan team. But if we can’t win it, I wish all the very best to India and they thoroughly deserve it!.. Chuk de India.. 🙂