cxf soap返回_通过CXF开发webService接口(soap协议maven项目)

《通过CXF开发webService接口(soap协议maven项目)》由会员分享,可在线阅读,更多相关《通过CXF开发webService接口(soap协议maven项目)(5页珍藏版)》请在人人文库网上搜索。

1、1. 引入cxf的jar包pom文件里面直接增加依赖junitjunit4.11 test org.springframework spring- webmvc4.0.0.RELEASEorg.apache.cxf apache-cxf 2.4.3pom2. 配置web.xml文件Archetype Created Web Application contextConfigLocation classpath:config/spring/metadataWebService-spring.xml org.springframework.web.context.ContextLoaderList。

2、ener CXFServlet org.apache.cxf.transport.servlet.CXFServlet CXFServlet /services/* encodingFilter org.springframework.web.filter.CharacterEncodingFilter encoding UTF-8 forceEncoding true encodingFilter /* 3. 配置cxf.xml文件4. 要开放的接口加上cxf服务的注解接口类:WebService (portName = inbound.webServices.ticket.saServic。

3、eSoap12 )javax.xml.ws.soap. MTOMpublic interface DemoService WebMethodpublic String demo( WebParam(name = demo) Demo demo);接口实现类:ComponentWebService (portName = inbound.webServices.ticket.saServiceSoap12 )BindingType (value = http:/www.w3.org/2003/05/soap/bindings/HTTP/ )public class DemoServiceImpl。

4、 implements DemoService publicString Demo(Demo demo) String userName = demo.getUserName();Stringpassword= demo.getPassword();return success;Demo实体类:publicClass Demo() public String userName;public String password;public StringgetUserName() returnuserName;public void setUserName(StringuserName) this.userName=userName;public StringgetPassword() returnpassword;public void setPassword(Stringpassword) this.password=password;5. 部署到tomcat启动即可,测试访问 ip:端口号/项目名称/services。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值