For the first time i’m trying to use a webservice in SSIS.
The webservice I’m trying to use is:
http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl
To test this webservice I use: https://wsdlbrowser.com/
I want to use the function CheckVat. There are two input fields, countrycode and vatnumber. The method returns the requestdate, valid, name and adress.
Request XML:
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:ec.europa.eu:taxud:vies:services:checkVat:types"> <SOAP-ENV:Body> <ns1:checkVat> <ns1:countryCode>NL</ns1:countryCode> <ns1:vatNumber>801837236B01</ns1:vatNumber> </ns1:checkVat> </SOAP-ENV:Body> </SOAP-ENV:Envelope> |
Result:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <checkVatResponse xmlns="urn:ec.europa.eu:taxud:vies:services:checkVat:types"> <countryCode>NL</countryCode> <vatNumber>801837236B01</vatNumber> <requestDate>2020-01-20+01:00</requestDate> <valid>true</valid> <name>GEMINI TECHNIEK B.V.</name> <address> METAALSTRAAT 00022 7483PD HAAKSBERGEN </address> </checkVatResponse> </soap:Body> </soap:Envelope> |
After checking this I created a simple test SSIS Package.
At first I create an Execute SQL Task that executes this query:
select 'NL' as countrycode, '801837236B01' as vatnumber.
Resultset: full result set
The resultset name = 0 and the variable name is use is User::Relations
The next step is to create a foreach loop that loops through the recordset. (Foreach ADO Enumerator)
In the loop I’ll add the web service task. In this task I’ll create an new HTTP connection with server URL:
http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl
I downloaded the WSDL file and stored this file in the projectfolder. When i choose to overwrite the WSDL file and click download: the specified web services description language file was downloaded successfully.
Then I defined the Inputs. So I selected CheckVatService as the service and i’ve chosen CheckVat as a method.
Instead of only the countryCode and the vatNumber, SSIS displays 5 input variables: countryCode, vatNumber, valid, name and adress. These are the output columns?!?
![]()
For this test I use a file connection as output.
The package does now look like this:
![]()
When I run the package I get an error:
[Web Service Task] Error: An error occurred with the
following error message:"Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebserviceTaskException:
Could not execute the Web method. The error is: Could not create an object of
the type ProxyNamespace.Boolean&. Check whether the default constructor
exists.. at
Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebMethodInvokerProxy.InvokeMethod(DTSWebMethodInfo
methodInfo, String serviceName, Object connection) at
Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebServiceTaskUtil.Invoke(DTSWebMethodInfo
methodInfo, String serviceName, Object connection, VariableDispenser
taskVariableDispenser) at
Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebServiceTask.executeThread()".
The first field that I didn’t map tot the input fields is of type boolean… If I map ‘dummy’ variables with no value to the remaining input fields I get no error, but no output either. The output file consist of only the xml header:
<?xml version="1.0" encoding="utf-16"?>
<dateTime>2020-01-20T00:00:00+01:00</dateTime>
Is there something I'm missing? or is the webservice not suitable to use in SSIS.