【发布时间】:2019-09-12 22:49:13
【问题描述】:
在对这个问题进行了长时间的研究之后,我遇到了一些困难。本质上,我正在尝试对公开的 Web 服务(我有 WSDL)进行 SOAP 调用。我能够运行我的 PowerShell 脚本来进行调用并返回 XML 结果。我无法将它连接到 SSIS 并传递要解析的 XML。我已经阅读了解释如何通过 web 服务(我在 webmethod 上收到错误消息)和脚本/流程任务的文章。
目前正在处理调用 PowerShell 脚本以进行 SOAP 调用并检索我可以解析并插入到 SQL 表中的 XML 响应的流程任务
进程/webservice/脚本任务 VB代码(不精通) PowerShell 将响应保存到文件并插入到 SQL 中
#setting TLS to 1.2 as webservice rejects 1.0
[System.Net.ServicePointManager]::SecurityProtocol =
[System.Net.SecurityProtocolType]::Tls12
#setting URL Endpoint
$uri = "WebserviceURL"
#structuring the request with the infile being the soap action with headers
$post = Invoke-WebRequest -Uri $uri -InFile c:\SOAPREQUESTACTION -ContentType "text/xml" -method post`
预期结果 - SSIS 能够将 XML 响应解析为变量并插入 SQL 表,之后它将在下一次 SOAP 调用时随着属性的变化而更新项目
示例响应
<?xml version='1.0' encoding='UTF-8'?><env:Envelope
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body>
<wd:Report_Data xmlns:wd="WEBSERVICEURN">
<wd:Report_Entry>
<wd:Preferred_Name_-_First_Name>Joe</wd:Preferred_Name_-_First_Name>
<wd:Preferred_Name_-_Last_Name>Professional</wd:Preferred_Name_-
_Last_Name>
<wd:businessTitle>Joe Professional Title</wd:businessTitle>
<wd:Department wd:Descriptor="Joes Professional Department">
</wd:Report_Entry></wd:Report_Data></env:Body></env:Envelope>
【问题讨论】:
-
你试过只用
New-WebServiceProxy -
我有,powershell sciprt 工作,更关心在 SSIS 中使用。我能够获得对变量的响应,但不确定如何调用和解析在 SSIS 中使用过的变量
-
将 XML 响应粘贴到您的问题中。我可以告诉你如何处理那个字符串
-
@KeithL OP 添加了 XML 响应检查一下
标签: xml powershell soap ssis