本文整理汇总了Python中pysimplesoap.client.SoapClient.loginCms方法的典型用法代码示例。如果您正苦于以下问题:Python SoapClient.loginCms方法的具体用法?Python SoapClient.loginCms怎么用?Python SoapClient.loginCms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pysimplesoap.client.SoapClient
的用法示例。
在下文中一共展示了SoapClient.loginCms方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_wsaa_exception
# 需要导入模块: from pysimplesoap.client import SoapClient [as 别名]
# 或者: from pysimplesoap.client.SoapClient import loginCms [as 别名]
def test_wsaa_exception(self):
"""Test WSAA for SoapFault"""
WSDL = "https://wsaa.afip.gov.ar/ws/services/LoginCms?wsdl"
client = SoapClient(wsdl=WSDL, ns="web")
try:
resultado = client.loginCms('31867063')
except SoapFault as e:
self.assertEqual(e.faultcode, 'ns1:cms.bad')
try:
resultado = client.loginCms(in0='31867063')
except SoapFault as e:
self.assertEqual(e.faultcode, 'ns1:cms.bad')
示例2: call_wsaa
# 需要导入模块: from pysimplesoap.client import SoapClient [as 别名]
# 或者: from pysimplesoap.client.SoapClient import loginCms [as 别名]
def call_wsaa(cms, wsdl=WSDL, proxy=None, cache=None, wrapper="", trace=False):
"Call the RPC method with the CMS to get the authorization ticket (TA)"
# create the webservice client
client = SoapClient(
location = wsdl[:-5], #location, use wsdl,
cache = cache,
#proxy = parse_proxy(proxy),
#cacert = cacert,
timeout = TIMEOUT,
ns = "ejb",
# TODO: find a better method to not include ns prefix in children:
# (wsdl parse should detect qualification instead of server dialect)
soap_server = "jetty",
namespace = "http://ejb.server.wsaa.dna.gov.py/",
soap_ns = "soapenv",
trace = trace)
# fix the wrong location (192.4.1.39:8180 in the WDSL)
##ws = client.services['WsaaServerBeanService']
##location = ws['ports']['WsaaServerBeanPort']['location']
##location = location.replace("192.4.1.39:8180", "secure.aduana.gov.py")
##ws['ports']['WsaaServerBeanPort']['location'] = wsdl[:-5] #location
# call the remote method
try:
results = client.loginCms(arg0=str(cms))
except:
# save sent and received messages for debugging:
open("request.xml", "w").write(client.xml_request)
open("response.xml", "w").write(client.xml_response)
raise
# extract the result:
ta = results['return'].encode("utf-8")
return ta