本文整理汇总了Python中suds.sudsobject.Object.httpcode方法的典型用法代码示例。如果您正苦于以下问题:Python Object.httpcode方法的具体用法?Python Object.httpcode怎么用?Python Object.httpcode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类suds.sudsobject.Object
的用法示例。
在下文中一共展示了Object.httpcode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: person
# 需要导入模块: from suds.sudsobject import Object [as 别名]
# 或者: from suds.sudsobject.Object import httpcode [as 别名]
#
# add the person (using the webservice)
#
print 'addPersion()'
result = client.service.addPerson(person)
print '\nreply(\n%s\n)\n' % str(result)
#
# Async
#
client.options.nosend=True
reply = '<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:addPersonResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://basic.suds.fedora.org"><addPersonReturn xsi:type="xsd:string">person (jeffӒ,ortel) at age 43 with phone numbers (410-555-5138,919-555-4406,205-777-1212, and pets (Chance,) - added.</addPersonReturn></ns1:addPersonResponse></soapenv:Body></soapenv:Envelope>'
request = client.service.addPerson(person)
result = request.succeeded(reply)
error = Object()
error.httpcode = '500'
client.options.nosend=False
# request.failed(error)
#
#
# create a new name object used to update the person
#
newname = client.factory.create('ns0:Name')
newname.first = 'Todd'
newname.last = None
#
# create AnotherPerson using Person
#
ap = client.factory.create('ns0:AnotherPerson')
ap.name = person.name