I have crated a CXF JAXWS Service as below.
I have provided a custom UserNameToken validator and a callback handler.
But this is not working. It throws an error everytime.
<http:inbound-endpoint address="http://localhost:8080/HelloService" exchange-pattern="request-response">
<cxf:jaxws-service serviceClass="com.example.service.HelloServiceImpl" >
<cxf:ws-security>
<cxf:ws-config>
<cxf:property key="action" value="UsernameToken" />
</cxf:ws-config>
<cxf:ws-custom-validator >
<cxf:username-token-validator ref="customUsernameTokenValidator" />
</cxf:ws-custom-validator>
</cxf:ws-security>
<cxf:properties>
<spring:entry key="ws-security.ut.validator" value-ref="customUsernameTokenValidator" ></spring:entry>
<spring:entry key="ws-security.callback-handler" value-ref="myPasswordCallback" ></spring:entry>
</cxf:properties>
.....
.....
And a policy on my WSDL binding as below
<sp:SupportingTokens>
<wsp:Policy>
<sp:UsernameToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
<wsp:Policy />
</sp:UsernameToken>
</wsp:Policy>
</sp:SupportingTokens>
I get the below error when I fire my request from SOAPUI with usernametoken and password.
2013-04-10 11:08:13,811 WARN [qtp1221956599-40 - /HelloService] logging.LogUtils (LogUtils.java:384) - Interceptor for {http://example.org/HelloService}ProductSOAPService#{http://example.org/HelloService}addCompany has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault
at org.mule.module.cxf.MuleInvoker.invoke(MuleInvoker.java:106)
at org.mule.module.cxf.MuleJAXWSInvoker.invoke(MuleJAXWSInvoker.java:47)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)
.....
.....
Caused by: java.lang.NullPointerException
at org.mule.module.cxf.MuleInvoker.invoke(MuleInvoker.java:60)
... 29 more
Please help me understand what I missing here.
Note: I have tried the Mule way of implementing the security on jaxws using cxf:ws-security and my service is working and giving proper response.