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


Python SOAPProxy.getRecords方法代码示例

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


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

示例1: SOAPProxy

# 需要导入模块: from SOAPpy import SOAPProxy [as 别名]
# 或者: from SOAPpy.SOAPProxy import getRecords [as 别名]
from SOAPpy import SOAPProxy

#dynamic elements of SOAP endpoint construction 
username, password, instance, gliderecord = 'user', 'pass', 'instance', 'endpoint'
proxy = "https://%s:%[email protected]%s.service-now.com/%s.do?SOAP" % (
    username, 
    password, 
    instance, 
    gliderecord, 
)

namespace = 'http://www.glidesoft.com/'

server = SOAPProxy(proxy,namespace)
#limit record set? 
start, end = 0, 1

response = server.getRecords(
    _order_by='number', 
    __first_row=start, 
    __last_row=end
)

for r in response:
    for field, value in r.__dict__.iteritems():
        print field, value    
print "size", len(response)

开发者ID:gaddie-3,项目名称:snsoapclient,代码行数:29,代码来源:getRecords.py

示例2: SOAPProxy

# 需要导入模块: from SOAPpy import SOAPProxy [as 别名]
# 或者: from SOAPpy.SOAPProxy import getRecords [as 别名]
for elem in soup.find(attrs={"name" : "getRecords"}).contents[0].contents[0].contents:
	if elem['name'][0:2] != "__": # Make sure it's actually a column name and not an extended parameter
		key_list.append(elem['name'])

# DUMP DATA INTO TABLE
# Open url with SOAP call - dynamic elements of SOAP endpoint construction 
username, password, gliderecord = '', '', table_name
proxy = "https://%s:%[email protected]%s.service-now.com/%s.do?displayvalue=all&SOAP" % (username, password, instance, gliderecord, )
namespace = 'http://www.glidesoft.com/'
server = SOAPProxy(proxy,namespace)
# Cycle through every 250 until you get nothing
con = MySQLdb.connect(host='localhost', user='root', passwd='niK6efiS', db = 'sndump', charset = 'utf8')
cur = con.cursor()
start = 0
end = 249
response = server.getRecords(__first_row=start, __last_row=end, __order_by='sys_updated_on')
print "started..."
date_n_ago = "%s" % (datetime.now() - timedelta(days=630))
date_n_ago = date_n_ago[0:10]
continue_loop = 1
while continue_loop==1:
	for r in response: # Each r is a dict containing keys/values which are column/data for the table
		if continue_loop==1 and r.sys_updated_on[0:10]<=date_n_ago:
			insertinto = "INSERT INTO " + table_name + " ("
			values = "VALUES ("
			for field, value in vars(r).items():
				if key_list.count(field) > 0:
					insertinto += "`%s`, " % (field)
					temp = con.escape_string(value)
					values += "\'%s', " % (temp)
			insertlen = len(insertinto) - 2
开发者ID:gaddie-3,项目名称:snsoapclient,代码行数:33,代码来源:updateIncident.py

示例3: SOAPProxy

# 需要导入模块: from SOAPpy import SOAPProxy [as 别名]
# 或者: from SOAPpy.SOAPProxy import getRecords [as 别名]
from SOAPpy import SOAPProxy

# dynamic elements of SOAP endpoint construction
username, password, instance, gliderecord = "admin", "explodev1234", "osuituat", "change_task"
proxy = "https://%s:%[email protected]%s.service-now.com/%s.do?SOAP" % (username, password, instance, gliderecord)
namespace = "http://www.glidesoft.com/"

server = SOAPProxy(proxy, namespace)

start = 0
end = 2
response = server.getRecords(__first_row=start, __last_row=end, __order_by="number")
for r in response:
    for field, value in r.__dict__.iteritems():
        print field, value


print "size", len(response)
开发者ID:gaddie-3,项目名称:snsoapclient,代码行数:20,代码来源:getrecords_with_limit.py


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