Hi All,
I have followed following link to create a username token security on CXF.
link : http://www.jroller.com/gmazza/entry/cxf_usernametoken_profile
I followed all the steps, but I am getting following error on running
client. I have created proper callbacks on both web server client and server
as well (plz see my cxf.xml below).
I using cxf-2.6.8.
Please help!!!
--------------------------------
Error:
------------------------------
NFO: Creating Service
{http://www.example.org/contract/DoubleIt}DoubleItService from WSDL:
https://localhost:8443/CXFWebService/services/DoubleItPort?wsdl
Using URL: https://localhost:8443/CXFWebService/services/DoubleItPort
Invoking doubleIt...
Jul 9, 2013 12:20:53 PM
org.apache.cxf.ws.security.policy.builders.HttpsTokenBuilder build
WARNING: sp:HttpsToken/wsp:Policy should have a value!
Jul 9, 2013 12:20:54 PM org.apache.cxf.ws.addressing.soap.MAPCodec
restoreExchange
WARNING: Response message does not contain WS-Addressing properties. Not
correlating response.
Jul 9, 2013 12:20:54 PM org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor
handleMessage
WARNING: Request does not contain Security header, but it's a fault.
Jul 9, 2013 12:20:54 PM org.apache.cxf.ws.addressing.ContextUtils
retrieveMAPs
WARNING: WS-Addressing - failed to retrieve Message Addressing Properties
from context
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: General
security error (WSSecurityEngine: No password callback supplied)
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156)
at $Proxy27.doubleIt(Unknown Source)
at
org.example.contract.doubleit.DoubleItPortType_DoubleItPort_Client.main(DoubleItPortType_DoubleItPort_Client.java:89)
Caused by: org.apache.cxf.binding.soap.SoapFault: General security error
(WSSecurityEngine: No password callback supplied)
at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:84)
at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:51)
at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:40)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
at
org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:113)
at
org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
at
org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:800)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1704)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1537)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1445)
at
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:660)
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134)
... 2 more
-----------------------------------------------------------------------------------------------
CXF.xml at client :
------------------------------------------------------------------------------------------------
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd">
<jaxws:client
name="{http://www.example.org/contract/DoubleIt}DoubleItPort"
createdFromAPI="true">
<jaxws:properties>
<entry key="ws-security.username" value="bob"/>
<entry key="ws-security.callback-handler"
value-ref="myPasswordCallback"/>
</jaxws:properties>
</jaxws:client>
<bean id="myPasswordCallback"
class="org.example.contract.doubleit.ClientPasswordCallback"/>
</beans>
-------------------------------------------------------------------------------------------------
cxf-servlet.xml on server :
---------------------------------------------------------------
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd">
<jaxws:endpoint
id="doubleit"
implementor="org.example.contract.doubleit.DoubleItPortTypeImpl"
address="/doubleit"
wsdlLocation="/root/workspace/CXF/CXFWebService/WebContent/wsdl/DoubleIt.wsdl">
<jaxws:properties>
<entry key="ws-security.callback-handler"
value-ref="myPasswordCallback"/>
</jaxws:properties>
</jaxws:endpoint>
<bean id="myPasswordCallback"
class="org.example.contract.doubleit.ServerPasswordCallback" />
</beans>
--
View this message in context:
http://cxf.547215.n5.nabble.com/UserName-token-security-on-CXF-General-security-error-WSSecurityEngine-No-password-callback-supplied-tp5730451.html
Sent from the cxf-user mailing list archive at Nabble.com.