c#SOAP VAT获得验证

时间:2016-09-06 14:48:16

标签: c# c#-4.0 soap soap-client

在我的项目中,我添加了引用http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl,并在我的代码中执行:

   ServiceReferenceVAT.checkVatRequest check = new ServiceReferenceVAT.checkVatRequest();
       check.Body.vatNumber = "IT";
       check.Body.countryCode = "01983251678";

现在,我不知道如何调用一种方法来驯服。当我检查时,这种方法不会出现。 (...),我如何验证我的增值税代码?

1 个答案:

答案 0 :(得分:1)

在此链接中作为问题的答案:https://blog.dotnetframework.org/2016/03/15/using-the-official-vies-api-in-c-for-vat-lookups/

var vat = new ServiceReferenceVAT.checkVatPortTypeClient();
           bool blnValid;
           string strName;
           string strAddress;
           string strCountryCode = "PT";
           string strVatNumber = "509358772";
       var t = vat.checkVat(ref strCountryCode, ref strVatNumber, out blnValid, out strName, out strAddress);