码迷,mamicode.com
首页 > 编程语言 > 详细

python的webservice请求

时间:2019-06-24 22:32:03      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:city   time   coding   turn   import   sof   arc   from   service   

1.pip install client

2.pip install suds-jurko

#coding=utf-8
from suds.client import Client
import time
url=‘http://www.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx?wsdl‘
client = Client(url)
def get_methods_name():
method_list=[]
for i in client.wsdl.services[0].ports[0].methods:
method_list.append(i)
return method_list
for i in get_methods_name():
print(i)
time.sleep(5)
func=getattr(client.service,i)
print(func(‘221.112.223.1‘))
# print(client.service.getCountryCityByIp(theIpAddress=‘221.112.223.1‘))

python的webservice请求

标签:city   time   coding   turn   import   sof   arc   from   service   

原文地址:https://www.cnblogs.com/xuzhongtao/p/11079845.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!