Passing complex type as a variable in Web service task
When you pass a complex type (the one represented by class) to a web service the BIDS UI allows you to enter values for every field of that type as constants. But what if you want to pass a variable? Once again the UI allows you to specify a variable for that complex type parameter. But how to make this variable in SSIS? I understand it should have the type of Object. But how to specify what the runtime type of this object is? And how to assign all fields to that object?
October 4th, 2011 11:05pm

When you pass a complex type (the one represented by class) to a web service the BIDS UI allows you to enter values for every field of that type as constants. But what if you want to pass a variable? Once again the UI allows you to specify a variable for that complex type parameter. But how to make this variable in SSIS? I understand it should have the type of Object. But how to specify what the runtime type of this object is? And how to assign all fields to that object? I'm not sure it is possible to use complex types with the Web service task. Even if it is possible, you have to use script to setup the object you want to pass.SSIS Tasks Components Scripts Services | http://www.cozyroc.com/
Free Windows Admin Tool Kit Click here and download it now
October 5th, 2011 12:05am

I'm not sure it is possible to use complex types with the Web service task. Well, it is certainly possible as I was able to do that. As I mentioned in my original post passing of constant values works. The UI displays a dialog screen where you can enter values for every field of the object you are passing. After that the Web service task works fine and passes this object made of constant values to the web service. However I want to be able to pass variables, not constants. Even if it is possible, you have to use script to setup the object you want to pass. My question is exactly about this. What exactly should I write in that script to initialize that object? Or how to instantiate the object of the type defined in a web service?
October 5th, 2011 10:39am

I'm not sure it is possible to use complex types with the Web service task. Well, it is certainly possible as I was able to do that. As I mentioned in my original post passing of constant values works. The UI displays a dialog screen where you can enter values for every field of the object you are passing. After that the Web service task works fine and passes this object made of constant values to the web service. However I want to be able to pass variables, not constants. Even if it is possible, you have to use script to setup the object you want to pass. My question is exactly about this. What exactly should I write in that script to initialize that object? Or how to instantiate the object of the type defined in a web service? Interesting. Try this: 1. Setup the complex type int the web service task. 2. Close the UI and then right-click on the task and select Properties. 3. Try to find out in which property the complex type setup is serialized. After you find this out, setup an SSIS expression which setups this property according to your needs.SSIS Tasks Components Scripts Services | http://www.cozyroc.com/
Free Windows Admin Tool Kit Click here and download it now
October 5th, 2011 10:42am

Unfortunately that is not the solution. The selected method's input parameters (complex or simple) are not shown in the Properties. Even if you serialize the whole web services task into a package configuration file you won't find the input parameters' values in it. So I'm still looking for an easy way how to set up a variable for an input parameter with a complex type (SSIS 2008 R2). Other answers in this forums (which have been written when SSIS 2005 was the current version) suggest to use the script task for calling the web service, e.g. Help Passing Complex Variable Types to a Web Service TaskSSIS Web Service Complex Type Inputs But Consuming WCF service with Complex Data type in SSIS states that this won't be necessary with SSIS 2008 (but unfortunately doesn't explain how it is expected to be done in SSIS 2008). Any news on this topic? Thanks in advance and best regards, Gerald
May 14th, 2012 4:29am

Also interested Can assign a 'typical' variable in a script task, but not quite making the connection for complex types.
Free Windows Admin Tool Kit Click here and download it now
May 21st, 2012 9:16pm

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

Other recent topics Other recent topics