I am trying to call a web service using the web service task and passing it variables, but even when I set variables to be Strings/any other data type, they always get passed out as objects. The call is then rejected based on the fact that there is no web service that accepts those parameter types. If there is a workaround to this problem, that would be great, otherwise I think I'm going to have to call the web services in a script task. Would someone please give me an example of the steps necessary to call a web service from the script task?
Thank you,
James Mac William
Can you instead post your code for us to review?|||currently I'm not using code to handle the service call. The IDE allows for a web service task to be called which I am using. It also allows for global variables to be declared within the package. You can set the global variables equal to any data type, but when they are passed, it is as an object rather than the datatype specified. My question is, can I convert that object to a string within the Web Service Task somehow, or is there a way to directly call the web service from the script task? I know that we can access pipeline elements such as variables from the script task if they are specified as input variables, perhaps there is a way to do this for web services too? I've already downloaded the wsdl file in another web service call that I was able to hardcode the string rather than pass a variable so it knows where the wsdl file is. Any thoughts? Help is much appreciated.|||To call a web service from a script task, you need to create a wrapper assembly in Visual Studio first for the web service. Then you can add a reference to the wrapper assembly in the script task.
This has an example of calling the Reporting Services web service from a script task: http://mgarner.wordpress.com/2007/06/06/consuming-the-reporting-services-web-service-inside-ssis/
|||So I guess the important part in this example is instantiating the proxy object. I saw the code "wsdl.exe /language:VB /out:ReportService.vb http://[ReportServerName]/ReportServer/ReportService.asmx?WSDL" in the example site that you gave me, but I'm still a bit fuzzy on how to instantiate this proxy object. Can you go into a bit more detail on how to do this. IE Where would I type the above line? Thanks for your help!|||From the Visual Studio command prompt. Or you can start a new VB or C# project, and add a web reference.|||so if I'm in SSIS and I want to make this proxy object programmatically, I would create a script task and then type out what I mentioned before? It didnt seem to be taking that. Is there perhaps some reference to the pipeline that I have to make? I apologize if I'm catching on slowly, I'm somewhat new to SSIS, I really appreciate your help.|||
James Mac William wrote:
so if I'm in SSIS and I want to make this proxy object programmatically, I would create a script task and then type out what I mentioned before? It didnt seem to be taking that. Is there perhaps some reference to the pipeline that I have to make? I apologize if I'm catching on slowly, I'm somewhat new to SSIS, I really appreciate your help.
James,
The command-line tool wsdl.exe can generate C# or VB.Net classes that enable you to consume a web service. The code from the output of running that command can be copied/pasted into your script task for ease of use. or, you can use csc.exe to generate an assembly that you can add as a reference to your script task.
Regards
Jamie
|||it works! thank you thank you thank you, I'm grateful for everyone's help here!
No comments:
Post a Comment