By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,913 Members | 1,305 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,913 IT Pros & Developers. It's quick & easy.

How to Implement WS security using CXF and WSS4J ?

P: 3
Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. <?xml version="1.0" encoding="UTF-8"?>
  4.  
  5. <beans xmlns="http://www.springframework.org/schema/beans"
  6.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
  7.                     xmlns:soap="http://cxf.apache.org/bindings/soap"
  8.     xsi:schemaLocation="http://www.springframework.org/schema/beans 
  9.        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  10.                        http://cxf.apache.org/bindings/soap
  11.                     http://cxf.apache.org/schemas/configuration/soap.xsd
  12.                            http://cxf.apache.org/jaxws 
  13.                            http://cxf.apache.org/schemas/jaxws.xsd">
  14.  
  15.  
  16.  
  17. <bean id="getAccountImpl" class="GetAccountImpl"
  18.         parent="webserviceImplParent" />
  19.  
  20.  
  21.  
  22. <bean id="ServerPasswordCallback" class="path of ServerPasswordCallback" />
  23.  
  24.     <jaxws:endpoint xmlns:tns="end point URL"
  25.         id="getAccount" implementor="#getAccountImpl"
  26.         wsdlLocation="location of the WSDl"
  27.         endpointName="tns:GetAccountPort" serviceName="tns:GetAccountService"
  28.         address="http://WS_IRA_HOST:WS_IRA_PORT/getaccount">
  29.  
  30.         <jaxws:inInterceptors>
  31.             <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" />
  32.             <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
  33.                 <constructor-arg>
  34.                     <map>
  35.                         <entry key="action" value="UsernameToken" />
  36.                         <entry key="passwordType" value="PasswordText" />
  37.                         <entry key="passwordCallbackClass" value="path of ServerPasswordCallback" />
  38.                     </map>
  39.                 </constructor-arg>
  40.             </bean>
  41.         </jaxws:inInterceptors>
  42.  
  43.     </jaxws:endpoint>
  44.  
  45. </beans>
  46.  
  47.  

here all the necessary packages are imported as well as exported and . jar files are included in .bnd class.


after up my server i will get error as:-



Caused by: org.springframework.beans.FatalBeanException: Class [org.apache.cxf.bus.spring.NamespaceHandler] for namespace [http://cxf.apache.org/core] does not implement the [org.springframework.beans.factory.xml.NamespaceHan dler] interface
at org.springframework.beans.factory.xml.DefaultNames paceHandlerResolver.resolve(DefaultNamespaceHandle rResolver.java:126)
at org.eclipse.gemini.blueprint.context.support.Deleg atedNamespaceHandlerResolver.resolve(DelegatedName spaceHandlerResolver.java:55)
at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1333)
at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1328)
at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.parseBeanDefinitions(Defau ltBeanDefinitionDocumentReader.java:135)
at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.registerBeanDefinitions(De faultBeanDefinitionDocumentReader.java:93)
at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.registerBeanDefinitions(XmlBeanDefinit ionReader.java:493)
at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:390)
Attached Images
File Type: jpg error.jpg (72.6 KB, 92 views)
Jul 9 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.