有什么办法可以避免SSIS程序包中的此错误?
该程序包使用Web服务任务调用Web服务方法。将该响应放入String类型的SSIS变量中,然后进行进一步处理。
有时该方法返回一个Empty响应;我无法控制它,因为它不是我的Web服务。这种响应是一种已知的可能性:当传递给该方法的GUID在Web服务后面的任何存储中都找不到匹配的行时,就会发生这种响应。我要处理此错误。麻烦的是(请参阅相关的question),这个特定的错误使我的SSIS错误处理陷入困境,直接进入程序包错误处理程序。
完整的错误文本为:
An error occurred with the following error message: "Microsoft.SqlServer.Dts.Runtime.DtsRuntimeException: The type of the value (Empty) being assigned to variable "User::WSResponse" differs from the current variable type (String). Variables may not change type during execution. Variable types are strict, except for variables of type Object. ---> System.Runtime.InteropServices.COMException: The type of the value (Empty) being assigned to variable "User::WSResponse" differs from the current variable type (String). Variables may not change type during execution. Variable types are strict, except for variables of type Object. at Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSVariable100.set_Value(Object pvValue) at Microsoft.SqlServer.Dts.Runtime.Variable.set_Value(Object value) --- End of inner exception stack trace --- at Microsoft.SqlServer.Dts.Runtime.Variable.set_Value(Object value) at Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebServiceTask.saveOutputToVariable(Object output) at Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebServiceTask.executeThread()".
我在想的是这样的东西:
编辑 奇怪的是,如果我选择文件作为输出而不是变量,则Web服务任务不会 not 返回Empty。在这种情况下,它将返回以下内容:
<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<Result>The result is null. Either the result is null or the Web method returns void.</Result>
不过,不确定我是否要开始写SSIS包中的文件系统或从中读取文件。
无论是Web服务本身,还是Web服务任务,似乎都带有****的错误。