当前位置: 首页>>代码示例>>Python>>正文


Python SOAPProxy.getQuote方法代码示例

本文整理汇总了Python中SOAPpy.SOAPProxy.getQuote方法的典型用法代码示例。如果您正苦于以下问题:Python SOAPProxy.getQuote方法的具体用法?Python SOAPProxy.getQuote怎么用?Python SOAPProxy.getQuote使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SOAPpy.SOAPProxy的用法示例。


在下文中一共展示了SOAPProxy.getQuote方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Copyright

# 需要导入模块: from SOAPpy import SOAPProxy [as 别名]
# 或者: from SOAPpy.SOAPProxy import getQuote [as 别名]
#!/usr/bin/env python

# Copyright (c) 2001 actzero, inc. All rights reserved.
ident = '$Id: quoteTest.py,v 1.5 2003/12/18 06:31:50 warnes Exp $'

import os, re
import sys
sys.path.insert(1, "..")

from SOAPpy import SOAPProxy

# Three ways to do namespaces, force it at the server level

server = SOAPProxy("http://services.xmethods.com:9090/soap",
                        namespace = 'urn:xmethods-delayed-quotes')

print "IBM>>", server.getQuote(symbol = 'IBM')

# Do it inline ala SOAP::LITE, also specify the actually ns

server = SOAPProxy("http://services.xmethods.com:9090/soap")
print "IBM>>", server._ns('ns1',
    'urn:xmethods-delayed-quotes').getQuote(symbol = 'IBM')

# Create a namespaced version of your server

dq = server._ns('urn:xmethods-delayed-quotes')
print "IBM>>", dq.getQuote(symbol='IBM')
print "ORCL>>", dq.getQuote(symbol='ORCL')
print "INTC>>", dq.getQuote(symbol='INTC')
开发者ID:nedmax,项目名称:SOAPpy,代码行数:32,代码来源:quoteTest.py

示例2: SOAPProxy

# 需要导入模块: from SOAPpy import SOAPProxy [as 别名]
# 或者: from SOAPpy.SOAPProxy import getQuote [as 别名]
sys.path.insert(1, "..")

from SOAPpy import SOAPProxy

# Check for a web proxy definition in environment
try:
    proxy_url = os.environ["http_proxy"]
    phost, pport = re.search("http://([^:]+):([0-9]+)", proxy_url).group(1, 2)
    proxy = "%s:%s" % (phost, pport)
except:
    proxy = None

# Three ways to do namespaces, force it at the server level

server = SOAPProxy("http://services.xmethods.com:9090/soap", namespace="urn:xmethods-delayed-quotes", http_proxy=proxy)

print "IBM>>", server.getQuote(symbol="IBM")

# Do it inline ala SOAP::LITE, also specify the actually ns

server = SOAPProxy("http://services.xmethods.com:9090/soap", http_proxy=proxy)
print "IBM>>", server._ns("ns1", "urn:xmethods-delayed-quotes").getQuote(symbol="IBM")

# Create a namespaced version of your server

dq = server._ns("urn:xmethods-delayed-quotes")
print "IBM>>", dq.getQuote(symbol="IBM")
print "ORCL>>", dq.getQuote(symbol="ORCL")
print "INTC>>", dq.getQuote(symbol="INTC")
开发者ID:sigma,项目名称:pywebsvcs,代码行数:31,代码来源:quoteTest.py


注:本文中的SOAPpy.SOAPProxy.getQuote方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。