webservice 实现

参考资料

http://blog.csdn.net/majian_1987/article/details/23269641

服务端和验证类见参考。

采用JaxWsProxyFactoryBean方式实现,客户端需要有服务端的Service接口类和参数及返回对象。

 

采用SOAPUI 测试的时候,头信息不会自动生成, 需要手动添加, 查看AddSoapHeader类里面XMLUtils.printDOM()生成的头信息,

 

 

<?xml version="1.0" encoding="utf-8"?>
<soap:Header>
<auth:authentication xmlns:auth="http://gd.chinamobile.com//authentication">
  <auth:systemID>1</auth:systemID>
  <auth:userID>test</auth:userID>
  <auth:password>test444</auth:password>
</auth:authentication>
</soap:Header>
 

 

 

  将 <soapenv:Header> 中的内容 COPY 到SOAPUI的XML<soapenv:Header>中,

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hy="http://hy.com/">
   <soapenv:Header>
      <auth:authentication xmlns:auth="http://gd.chinamobile.com//authentication">
      	<auth:systemID>1</auth:systemID>
      	<auth:userID>test</auth:userID>
      	<auth:password>test</auth:password>
      </auth:authentication>
  </soapenv:Header> 
   
   <soapenv:Body>
      <hy:getResponse>
         <!--Optional:-->
         <arg0>Hello</arg0>
      </hy:getResponse>
   </soapenv:Body>
</soapenv:Envelope>

 

 

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值