本文整理汇总了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)
示例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
示例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)