微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

分配给变量的值的类型空

如何解决分配给变量的值的类型空

有什么办法可以避免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()".  

我在想的是这样的东西:

  1. 对[可以处理Empty的某些SSIS数据类型进行响应-有吗?]
  2. 值是否为空?如果是这样,可以通过发出行为良好的SSIS错误解决此问题。
  3. 否则,将值转换为SSIS字符串并继续。

编辑 奇怪的是,如果我选择文件作为输出而不是变量,则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服务任务,似乎都带有****的错误

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。