WebService客户端,接收数据解析存入数据库

WebService客户端,实现的功能是接收数据,按格式解析数据,最后存入相应数据库。


需求:

同步设备信息接口

url:http://localhost:54059/Service1.asmx

函数名:GetDevConfigInfo

参数:无

返回值:string

返回值格式:

设备编号,设备名称,设备类型,设备IP,设备端口号,设备位置,安装时间;设备编号,设备名称,设备类型,设备IP,设备端口号,设备位置,安装时间;


思路分析:通过WSDL文件生成客户端Client,通过客户端Client得到数据流。Dao层实现对数据流的解析和把数据插入数据库的功能。Servive层调用Client和Dao实现把接收的数据解析存入数据库的功能。Controller层做了一个按钮触发,点击按钮执行Service。



导入WSDL文件

File---New---Other---Web Service Client


两种方式导入WSDL文件。如果有.wsdl源文件可以通过WSDL File选取源文件路径;或者选取WSDL URL。


点击Next----再点击Finish

WSDL文件

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="itarge-park" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="itarge-park" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types>
    <s:schema elementF
  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值