Arrays in WebService SSIS 2008
So I have a Web Service that works just fine when I enter the parameter values myself. I get results and can parse it out, storing the results into a table. I even have it working in a "For Each Loop" for one of my variables. The issue I have is that the Web Service accepts 3 variables, the first being an Array. How can I populate the array variable for web service? If it requires a script, can I get an example to a link to one? I'm not very familiar with scripts.Werner
May 11th, 2012 10:48am

Map it to the Object type of the SSIS variable and then shred it.Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
May 11th, 2012 10:50am

I've never tried it, but the first thing I would suggest is to create an object variable and then create/load the array via a script task. Then see if you can pass the object variable in for the Array param. If that does not work, then it is relatively easy to use a webservice in a script task if you first create the proxy classes in a Visual studio project and then copy the resulting code into a script task. Here's an example http://blogs.msdn.com/b/dataaccesstechnologies/archive/2010/01/28/consuming-web-services-in-ssis-script-task.aspx Chuck
May 11th, 2012 10:50am

you can create an object variable as arthur said, and fill the object variable with an Array in Script task with a simple script like this: public void Main() { System.Collections.ArrayList arr = new System.Collections.ArrayList(); arr.Add("the first item"); arr.Add("the second item"); arr.Add("the third item"); Dts.Variables["User::Collection"].Value = arr; Dts.TaskResult = (int)ScriptResults.Success; } http://www.rad.pasfu.com
Free Windows Admin Tool Kit Click here and download it now
May 13th, 2012 4:41pm

So I've gone ahead and created a script and as a first pass, hardcoded the values to test the passing of an array is an object. What I've noticed and is causing an error is that the variable Input list first shows the type as and INT(). Click OK and Open for EDIT, review the Input list and I see that int[] has changed to int - causing a failure in the web service call. Any ideas? Werner
May 26th, 2012 12:26pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics