Techbook: Python and SOAP
Techbook: Python and SOAP: "import SOAPpy
WSDL_URI = 'http://www.xmethods.net/sd/2001/TemperatureService.wsdl'
service = SOAPpy.WSDL.Proxy(WSDL_URI)
# if you are behind a proxy server, you need to set this
service.soapproxy.http_proxy = 'PROXY_HOST:PROXY_PORT'
# set config so that we dump the SOAP envelopes
# (sometimes you will be thrilled to see the SOAP envelopes)
service.soapproxy.config.dumpSOAPOut = 1
service.soapproxy.config.dumpSOAPIn = 1
temp = service.getTemp('90210') # get temperature in Beverly Hills
print 'The temperature in Beverly Hills is',temp,'F'"
WSDL_URI = 'http://www.xmethods.net/sd/2001/TemperatureService.wsdl'
service = SOAPpy.WSDL.Proxy(WSDL_URI)
# if you are behind a proxy server, you need to set this
service.soapproxy.http_proxy = 'PROXY_HOST:PROXY_PORT'
# set config so that we dump the SOAP envelopes
# (sometimes you will be thrilled to see the SOAP envelopes)
service.soapproxy.config.dumpSOAPOut = 1
service.soapproxy.config.dumpSOAPIn = 1
temp = service.getTemp('90210') # get temperature in Beverly Hills
print 'The temperature in Beverly Hills is',temp,'F'"
0 Comments:
Post a Comment
<< Home