本文整理汇总了Python中pysimplesoap.client.SoapClient.checkVat方法的典型用法代码示例。如果您正苦于以下问题:Python SoapClient.checkVat方法的具体用法?Python SoapClient.checkVat怎么用?Python SoapClient.checkVat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pysimplesoap.client.SoapClient
的用法示例。
在下文中一共展示了SoapClient.checkVat方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_issue8_wsdl
# 需要导入模块: from pysimplesoap.client import SoapClient [as 别名]
# 或者: from pysimplesoap.client.SoapClient import checkVat [as 别名]
def test_issue8_wsdl(self):
"""Test europa.eu tax service (namespace - wsdl call)"""
URL='http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl'
client = SoapClient(wsdl=URL)
# check the correct target namespace:
self.assertEqual(client.namespace,
"urn:ec.europa.eu:taxud:vies:services:checkVat:types")
# call the webservice to check everything else:
vat = 'BE0897290877'
code = vat[:2]
number = vat[2:]
res = client.checkVat(countryCode=code, vatNumber=number)
# check returned values:
self.assertEqual(res['name'], "SPRL B2CK")
self.assertEqual(res['address'], "RUE DE ROTTERDAM 4 B21\n"
"4000 LIEGE")
示例2: test_issue8_raw
# 需要导入模块: from pysimplesoap.client import SoapClient [as 别名]
# 或者: from pysimplesoap.client.SoapClient import checkVat [as 别名]
def test_issue8_raw(self):
"""Test europa.eu tax service (namespace - raw call)"""
client = SoapClient(
location="http://ec.europa.eu/taxation_customs/vies/services/checkVatService",
action='', # SOAPAction
namespace="urn:ec.europa.eu:taxud:vies:services:checkVat:types"
)
vat = 'IE6388047V'
code = vat[:2]
number = vat[2:]
res = client.checkVat(countryCode=code, vatNumber=number)
self.assertEqual(unicode(res('countryCode')), "IE")
self.assertEqual(unicode(res('vatNumber')), "6388047V")
self.assertEqual(unicode(res('name')), "GOOGLE IRELAND LIMITED")
self.assertEqual(unicode(res('address')), "1ST & 2ND FLOOR ,GORDON HOUSE ,"
"BARROW STREET ,DUBLIN 4")
示例3: test_issue8
# 需要导入模块: from pysimplesoap.client import SoapClient [as 别名]
# 或者: from pysimplesoap.client.SoapClient import checkVat [as 别名]
def test_issue8(self):
"Test europa.eu tax service (WSDL namespace)"
VIES_URL='http://ec.europa.eu/taxation_customs/vies/services/checkVatService.wsdl'
client = SoapClient(
location = "http://ec.europa.eu/taxation_customs/vies/services/checkVatService",
action = '', # SOAPAction
namespace = "urn:ec.europa.eu:taxud:vies:services:checkVat:types",
trace = False
)
vat = 'BE0897290877'
code = vat[:2]
number = vat[2:]
res = client.checkVat(countryCode=code, vatNumber=number)
self.assertEqual(str(res('countryCode')), "BE")
self.assertEqual(str(res('vatNumber')), "0897290877")
self.assertEqual(str(res('name')), "SPRL B2CK")
self.assertEqual(str(res('address')), "RUE DE ROTTERDAM 4 B21\n4000 LIEGE")