Much obliged for any help I can get on this one. I feel like I must be missing something stupid:
I have an Axis2 (1.5.1) web service being invoked by a WCF (.NET 3.5) client application.
The web service works fine without any authentication/inflow security configuration, but I have been asked to implement authentication using a security header.
I am using this kind of configuration in services.xml:
When the WCF client calls the service, the security header is like this:
Which looks fine to me (what do I know?), but Axis2/Rampart fails to authenticate the request:
org.apache.axis2.engine.AxisEngine receive WSDoAllReceiver: security processing failed
org.apache.axis2.AxisFault: WSDoAllReceiver: security processing failed
Caused by: org.apache.ws.security.WSSecurityException: The security token could not be authenticated or authorized
... 30 more
I have a log message in my callback handler's static initializer that tells me that the class was loaded, but the handle method is never called.
There, I found that this exception is coming up here:
But, as you can see above, WSConstants.PASSWORD_TEXT matches what I am getting in the request (it is "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText") so I am at a loss for why this might be happening.
Thanks for any insights you can provide.
Joined: Mar 30, 2011
It's unfortunate that I was not able to get any help on this one, so I'm back to help myself.
Your problem is that your application server (WAS 6.1) has a default installation of Axis2 to provide "out-of-the-box" web service support, and you are not using it. This is possibly because there is something wrong with or you don't like the Axis2 version that comes with WAS for some reason, or because you don't know it is there. Your problem is that your application server is loading Axis2 components from the out-of-the-box version and then probably some additional components from your application's libs/jars.
Basically, you are probably working with some sort of dirty, Frankenstein version of Axis2 and that is leading to problems. Make sure all of your Axis2 resources are coming from where you expect them, and you should be fine.
Joined: Mar 30, 2011
Thanks for your help, Guy.
It turns out the application was configured to do class loading parent- or container- first, so the server would load the WAS version of Axis2 before the version in my application. The easy fix would be to switch this to application-first class loading, which is the default.
It turns out I can't do this because another 3rd-party component in the application requires the container-first class loading scheme, and it breaks if I switch to application-first class loading.
I am not happy about it, but to resolve this, I took the Axis2 classes and resources I needed and added them to my class tree (WEB-INF/classes) and documented this everywhere I could think to. This works because I understand the load order is now (with parent-first or container-first class loading):
2. container/application server classpath