kettle通过Webservice获取天气信息
source link: https://blog.51cto.com/u_13753753/5756555
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
kettle通过Webservice获取天气信息
精选 原创通过kettle工具,通过webservice获取天气信息,写成xml格式文件
Kettle可通过两种选择获取webservice结果,一种是web服务查询(web service lookup),还一种是利用HTTP POST,本文介绍的是使用web服务查询的方式,数据来源为http://www.webxml.com.cn/WebServices/WeatherWebService.asmx
3.实现步骤
检查http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl,确认需要调用的webservice接口,相关请求和响应
如上图所示,请求的参数为theCityName,string型。响应为getWeatherbyCityNameResult,ArrayOfString型。因此实现方法如下:
主要配置"限制"为1,即生成一条记录,用于下一步参数所需即可。
web 服务查询
输入url后加载,选择getWeatherbyCityName操作。
注意此处输出选择了getWeatherbyCityNameResult的ArrayOfstring类型,将信息一次输出,如果通过"获取字段",只能获得一行记录
xml文件输出
"内容","字段"页保持默认即可。
文本文件输出
"内容"页保持默认即可。
输出结果如下:
- 赞
- 收藏
- 评论
- 分享
- 举报
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK