需要Mirth Web Service Sender的配置数据

问题描述 投票:0回答:1

第一次使用欢乐。我们将与外部服务进行沟通。 SOAP消息中SOAP信封的一部分是userId和passWord。除此之外,我们需要基本上执行每次调用服务时创建唯一令牌的哈希。我需要XML负载的那部分来自一个函数。是否有一种方法可以将一段数据插入到SOAP函数调用的结果中的SOAP Envelope中?

mirth mirth-connect
1个回答
0
投票

首先,您需要使用Web Service Sender Connector Type。在这个例子中,我选择了一个在线天气网络服务。

enter image description here

粘贴WSDL URL(橙色)并单击“获取操作”按钮(红色)

选择正确的服务后,单击“生成信封”按钮(红色),这将为您创建一个肥皂存根。像这样的东西,你可以使用这样的变量$ {variableName}

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET">
   <soapenv:Header/>
   <soapenv:Body>
      <web:GetCitiesByCountry>
         <!--Optional:-->
         <web:CountryName>${myGeneratedCountryName}</web:CountryName>
      </web:GetCitiesByCountry>
   </soapenv:Body>
</soapenv:Envelope>

要使用计算值填充变量,您需要使用,例如,javascript转换器。

创建一个新目标并编辑变换器。

enter image description here

然后你可以使用javascript来计算你的价值。

enter image description here

最后一行用于使变量及其内容可用于Web Service Sender。它像java Map一样工作

$co('myGeneratedCountryName',country);

但是,还有其他方法,例如代码模板。如果您是Mirth Connect的新手,我建议您阅读涵盖此用例和其他许多用途的Mirth Connect User Guide

© www.soinside.com 2019 - 2024. All rights reserved.