如何修复错误“输入 Web 服务描述语言 (WSDL) 文件无效”?
当我将 DTSX 文件部署到生产服务器时遇到问题。
在 DTSX 文件中,我通过 Web 服务任务使用 WebService, Web 服务要求提供必须从本地路径下载的 WSDL 文件。
我的机器上没有问题,但在生产服务器上它永远不会存在。
我认为要求我的客户获得进入他的生产服务器并创建一个文件夹来存储该 wsdl 文件的权限是不可接受的。另外当wsdl改变时会发生什么?我将不得不再次部署我的 dtsx 包,并替换服务器中的 wsdl 文件。所以我认为这不是一个选择。
所以,我的问题是,
是否有一种可能的方法可以避免使用 wsdl 规范的物理文件,或者可以将其部署在 dtsx 部署包中,或者将其保存在变量中,或者我还能如何做到这一点?
我已经搜索了很多,但仍然没有运气。
任何帮助将不胜感激。
I'm facing a problem when I deploy a DTSX File to a production server.
In the DTSX file I consume a WebService through the Web Service Task
,
The WebService asks for a WSDL File that it has to download from a local path.
There is no problem in my machine, but in the production server it won't ever exists.
I think it is not acceptable to ask to my client to get me permissions to enter in his production server and create a folder to store that wsdl file. In addition what will happen when the wsdl changes? I will have to deploy my dtsx package again and also replace the wsdl file in the server. So I think it is not an option.
So, my question is,
Is there a possible way to avoid to have a physical file with the wsdl especifcation, or it could be deployed within the dtsx deployment package, or save it in a variable, or how else I could do that?
I've been searching a lot, but still not luck.
Any help would be really appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要实现此目的,一种选择是使用
Script Task
并在 .NET 命名空间System.Net.WebClient
的帮助下,您可以访问 WSDL URL 路径并将 WSDL 文件的内容下载到系统的临时文件夹路径。您可以使用 .NET 方法System.IO.Path 获取系统的临时文件夹路径,即环境变量
。然后,新生成的 WSDL 文件临时路径可以存储在 SSIS 包变量中,然后可以在 Web 服务任务中配置该变量以供使用,而不是依赖本地路径。最初,在开发过程中,您需要在本地路径中包含 WSDL 文件,但是一旦将包部署到生产环境中,本地驱动器上就不需要存在 WSDL 文件。TEMP
的值。 GetTempPath()希望有帮助。
To achieve this, one option would be to make use of
Script Task
and with the help of .NET namespaceSystem.Net.WebClient
, you can access the WSDL URL path and download the contents of the WSDL file to the system's temporary folder path. You can get the system's temporary folder path, which is the value of the environment variableTEMP
, using the .NET methodSystem.IO.Path.GetTempPath()
. The newly generated temporary path of the WSDL file can be then stored in an SSIS package variable, which can then be configured in theWeb Service Task
for it to use instead of relying on a local path. Initially, during development you will need to have the WSDL file in the local path but once you deploy the package to the production, the WSDL file need not exist on the local drive.Hope that helps.