本文整理汇总了Python中SOAPpy.SOAPProxy.getWeatherbyCityName方法的典型用法代码示例。如果您正苦于以下问题:Python SOAPProxy.getWeatherbyCityName方法的具体用法?Python SOAPProxy.getWeatherbyCityName怎么用?Python SOAPProxy.getWeatherbyCityName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SOAPpy.SOAPProxy
的用法示例。
在下文中一共展示了SOAPProxy.getWeatherbyCityName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: structType
# 需要导入模块: from SOAPpy import SOAPProxy [as 别名]
# 或者: from SOAPpy.SOAPProxy import getWeatherbyCityName [as 别名]
# -*- coding: utf-8 -*-
#import sys
#reload(sys)
#sys.setdefaultencoding('utf8')
from SOAPpy import structType
from SOAPpy import headerType
from SOAPpy import SOAPProxy
n = 'http://WebXml.com.cn'
url = 'http://ws.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl'
ct = structType(data = {'Host' : 'www.webxml.com.cn',
'Content-Type':'text/xml; charset=utf-8',
'SOAPAction': "http://WebXml.com.cn/getWeatherbyCityName"})
ct._validURIs = []
ct._ns = ("ns1", "https://www.xxxxx.com/xxxx")
hd = headerType(data = {"AuthHeader" : ct})
server = SOAPProxy(url, namespace=n, soapaction="http://WebXml.com.cn/getWeatherbyCityName")
server.soapproxy.header = hd
server.config.dumpSOAPOut = 1
server.config.dumpSOAPIn = 1
server.getWeatherbyCityName(theCityName='58367')