本文整理汇总了Python中suds.sax.element.Element.children方法的典型用法代码示例。如果您正苦于以下问题:Python Element.children方法的具体用法?Python Element.children怎么用?Python Element.children使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类suds.sax.element.Element
的用法示例。
在下文中一共展示了Element.children方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_auth_header
# 需要导入模块: from suds.sax.element import Element [as 别名]
# 或者: from suds.sax.element.Element import children [as 别名]
def set_auth_header(self):
"""Set up the authorization header"""
auth_user = Element("username").setText(self.api_user)
auth_key = Element("apiKey").setText(self.api_key)
auth_header = Element("authenticate", ns=self.ims_ns)
auth_header.children = [auth_user, auth_key]
return auth_header
示例2: set_object_mask
# 需要导入模块: from suds.sax.element import Element [as 别名]
# 或者: from suds.sax.element.Element import children [as 别名]
def set_object_mask(self, data):
"""Create an object mask to tell the API what we want"""
print "%sObjectMask" % self.object_type
el = Element("%sObjectMask" % self.object_type, ns=self.ims_ns)
mask = Element("mask")
mask = self.build_soap_header(mask, data)
el.children = [mask]
return el
示例3: Client
# 需要导入模块: from suds.sax.element import Element [as 别名]
# 或者: from suds.sax.element.Element import children [as 别名]
from suds.client import Client
from suds.transport.http import HttpAuthenticated
url = 'http://academico.espoch.edu.ec/OAS_Interop/Infogeneral.wsdl'
#url adicional
urlCarrera = 'http://academico.espoch.edu.ec/OAS_Interop/Infocarrera.wsdl'
cliente = Client(url)
from suds.sax.element import Element
#Definimos el nombre de usuario
user = Element('acad:username').setText('webmail')
#Definimos la contraseña
pwd = Element('acad:password').setText('webmail')
#Creamos el elemento padre, y el espacio de nombres
reqsoapheader = Element('acad:credentials', ns=['acad','http://academico.espoch.edu.ec/'])
#agregamos usuario y contraseña al padre
reqsoapheader.children = [user, pwd]
#Seteamos los soapheaders con las credenciales de login
cliente.set_options(soapheaders=reqsoapheader)
#Llamamos a los servicios web
a = cliente.service.GetCiudades()
print a
示例4: Client
# 需要导入模块: from suds.sax.element import Element [as 别名]
# 或者: from suds.sax.element.Element import children [as 别名]
#!/usr/bin/python
from suds.client import Client
from SOAPpy import WSDL
from suds.sax.element import Element
from suds.sax.attribute import Attribute
import logging
logging.getLogger('suds.client').setLevel(logging.DEBUG)
logging.basicConfig(filename="/tmp/suds.log", level=logging.INFO)
url = 'http://1ocalhost/SDP_SMS/parlayx_sms_notification_manager_service_2_3.wsdl'
client = Client(url, location='http://196.201.216.14:8310/SmsNotificationManagerService/services/SmsNotificationManager')
spId = Element('spId').setText('35000001')
spPassword = Element('spPassword').setText('somepassword')
serviceId = Element('serviceId').setText('12345')
timeStamp = Element('timeStamp').setText('20120731064245')
reqsoapheader = Element('RequestSOAPHeader')
reqsoapheader.children = [spId,spPassword,serviceId,timeStamp]
client.set_options(soapheaders=reqsoapheader)
reference = client.factory.create('ns0:SimpleReference')
reference.endpoint = 'http://localhost/index.php'
reference.interfaceName = 'notifySmsReception'
reference.correlator = '1234'
reference.smsServiceActivationNumber = '23424'
reference.criteria = 'Love'
client.service.startSmsNotification('http://localhost/index.php','notifySmsReception','1234', '23424', 'Love')
print client.last_received()
示例5: Client
# 需要导入模块: from suds.sax.element import Element [as 别名]
# 或者: from suds.sax.element.Element import children [as 别名]
logging.getLogger('suds.client').setLevel(logging.DEBUG)
logging.basicConfig(filename="/tmp/sendSms.log", level=logging.INFO)
url = 'http://localhost/parlayx_sms_send_service_2_2.wsdl'
client = Client(url, location='http://localhost:8310/SendSmsService/services/SendSms')
passw = cryp.update('12345'+'pass'+'20130402115545')
password = cryp.hexdigest()
#print client
spId = Element('spId').setText('1234')
spPassword = Element('spPassword').setText(password)
serviceId = Element('serviceId').setText('12345')
timeStamp = Element('timeStamp').setText('20130402115545')
linkId = Element('linkid').setText('')
oa = Element('OA').setText('tel:254706123456')
fa = Element('FA').setText('tel:254706123456')
reqsoapheader = Element('RequestSOAPHeader')
reqsoapheader.children = [spId,spPassword,serviceId,timeStamp,linkId,oa,fa]
client.set_options(soapheaders=reqsoapheader)
reference = client.factory.create('ns0:SimpleReference')
reference.endpoint = 'http://localhost/index.php'
reference.interfaceName = 'SmsNotification'
reference.correlator = '12345678'
client.service.sendSms('254706123456','949','0','This is a test message from Simon',reference)
#print client.last_sent()
print client.last_received()