通过CXF开发webService接口(soap协议、maven项目)
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
1. 引入cxf的jar包
pom文件里面直接增加依赖
< dependency>
2. 配置web.xml文件
xml version= "1.0" encoding= "UTF-8" ?>
< web-app xmlns= "/xml/ns/javaee"
xmlns:xsi= "/2001/XMLSchema-instance" xsi:schemaLocation=
"/xml/ns/javaee
/xml/ns/javaee/web-app_3_1.xsd" version= "3.1" >
< display-name >Archetype Created Web Application
< context-param >
< filter-class>
org.springframework.web.filter.CharacterEncodingFilter
web-app>
3. 配置cxf.xml文件
xml version= "1.0" encoding= "UTF-8" ?>
< beans xmlns=
"/schema/beans"
xmlns:xsi=
"/2001/XMLSchema-instance" xmlns:jaxws= "/jaxws"
xmlns:context=
"/schema/context"
xmlns:jaxrs= "/jaxrs"
xsi:schemaLocation=
"/schema/beans
/schema/beans/sprin
g-beans.xsd
/jaxws
/schemas/jaxws.xsd
/schema/context
/schema/context/spr ing-context.xsd
/jaxrs
/schemas/jaxrs.xsd" >
"classpath:META-INF/cxf/cxf-servlet.xml" /> "org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor" > "org.apache.cxf.jaxws.JaxWsServerFactoryBean" scope= "prototype" >