通过CXF开发webService接口(soap协议、maven项目)

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

1. 引入cxf的jar包

pom文件里面直接增加依赖

< dependency>

junit

junit

4.11

test

org.springframework

spring- webmvc

4.0.0.RELEASE

org.apache.cxf

apache-cxf

2.4.3

pom

2. 配置web.xml文件

< 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 >

contextConfigLocation

classpath:config/spring/metadata WebService-spring.xml

org.springframework.web.conte xt.ContextLoaderListener

CXFServlet

org.apache.cxf.transport.servl et.CXFServlet

CXFServlet

/services/*

encodingFilter

< filter-class>

org.springframework.web.filter.CharacterEncodingFilter

encoding

UTF-8

forceEncoding

true

encodingFilter

/*

3. 配置cxf.xml文件

< 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" >

相关文档
最新文档