-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
20 lines (20 loc) · 812 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# -*- 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')