python3 suds-jurko webservice

import random
import time

from suds.client import Client
from suds.xsd.doctor import Import,ImportDoctor

from suds.client import Client

import json
# 1 天气预报Web服务,数据来源于中国气象局
# api_url = 'http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl' # ok
# imp = Import('http://www.w3.org/2001/XMLSchema',location='http://www.w3.org/2001/XMLSchema.xsd')
# imp.filter.add('http://WebXml.com.cn/')
# doctor = ImportDoctor(imp)
# client = Client(api_url,doctor=doctor)
# print('查询服务端方法:\n' + str(client))
# res = client.service.getWeatherbyCityName(u'北京')
# print(res)

# 地址来源搜索 WEB 服务(是目前最完整的IP地址数据)
# api_url = 'http://www.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx?wsdl'
# client = Client(api_url)
# print('查询服务端方法:\n' + str(client))
# res = client.service.getCountryCityByIp('114.114.114.114')
# res = client.service.getCountryCityByIp('192.168.1.1')
# print(res)

# 随机英文、数字和中文简体字 WEB 服务
# api_url = 'http://www.webxml.com.cn/WebServices/RandomFontsWebService.asmx?wsdl'
# client = Client(api_url)
# print('查询服务端方法:\n' + str(client))
# res = client.service.getCharFonts('97')
# print(res)

# 中国邮政编码 <-> 地址信息双向查询/搜索 WEB 服务
# api_url = 'http://www.webxml.com.cn/WebServices/ChinaZipSearchWebService.asmx?wsdl' # ok
# imp = Import('http://www.w3.org/2001/XMLSchema',location='http://www.w3.org/2001/XMLSchema.xsd')
# imp.filter.add('http://WebXml.com.cn/')
# doctor = ImportDoctor(imp)
# client = Client(api_url,doctor=doctor)
# print('查询服务端方法:\n' + str(client))
# # res = client.service.getSupportCity(u'新疆')
# res = client.service.getSupportProvince()
# print(res)

# 验证码图片 WEB 服务 支持中文、字母、数字 图像和多媒体
# api_url = 'http://www.webxml.com.cn/WebServices/ValidateCodeWebService.asmx?wsdl'
# client = Client(api_url)
# print('查询服务端方法:\n' + str(client))
# res = client.service.cnValidateByte('不错不错')
# print(res)

# Email 电子邮件地址验证 WEB 服务
# api_url = 'http://www.webxml.com.cn/WebServices/ValidateEmailWebService.asmx?wsdl' # ok
# client = Client(api_url)
# print('查询服务端方法:\n' + str(client))
# res = client.service.ValidateEmailAddress('test@qq.com')
# print(res)

# 中文简体字 <->繁体字转换 WEB 服务
# api_url = 'http://www.webxml.com.cn/WebServices/TraditionalSimplifiedWebService.asmx?wsdl' # ok
# client = Client(api_url)

# 中文 <-> 英文双向翻译 WEB 服务
# api_url = 'http://www.webxml.com.cn/WebServices/TranslatorWebService.asmx?wsdl' # ok
# client = Client(api_url)
# print('查询服务端方法:\n' + str(client))
# # res = client.service.getEnCnTwoWayTranslator('test')
# # res = client.service.getEnCnTwoWayTranslator('智能')
# res = client.service.getEnCnTwoWayTranslator('智能test')
# print(res)


# 火车时刻表 WEB 服务 (第六次提速最新列车时刻表)
# api_url = 'http://www.webxml.com.cn/WebServices/TrainTimeWebService.asmx?wsdl' # ok
# imp = Import('http://www.w3.org/2001/XMLSchema',location='http://www.w3.org/2001/XMLSchema.xsd')
# imp.filter.add('http://WebXml.com.cn/')
# doctor = ImportDoctor(imp)
# client = Client(api_url,doctor=doctor)
# print('查询服务端方法:\n' + str(client))
# # res = client.service.getStationNameDataSet()
# res = client.service.getStationName()
# print(res)

# 国内飞机航班时刻表 WEB 服务
# api_url = 'http://www.webxml.com.cn/webservices/DomesticAirline.asmx?wsdl' # ok
# imp = Import('http://www.w3.org/2001/XMLSchema',location='http://www.w3.org/2001/XMLSchema.xsd')
# imp.filter.add('http://WebXml.com.cn/')
# doctor = ImportDoctor(imp)
# client = Client(api_url,doctor=doctor)
# # client = Client(api_url)
# print('查询服务端方法:\n' + str(client))
# res = client.service.getDomesticAirlinesTime('北京','烟台','2019-04-25')
# print(res)

 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

生命的脚步从不停歇

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值