当前位置: 首页>>代码示例>>Python>>正文


Python SoapClient.checkVat方法代码示例

本文整理汇总了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")
开发者ID:smartylab,项目名称:pysimplesoap,代码行数:18,代码来源:issues_test.py

示例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")
开发者ID:smartylab,项目名称:pysimplesoap,代码行数:19,代码来源:issues_test.py

示例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")
开发者ID:KongJustin,项目名称:pysimplesoap,代码行数:21,代码来源:issues_tests.py


注:本文中的pysimplesoap.client.SoapClient.checkVat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。