概要
主机集成服务器包括 Visual Studio 设计器允许创建的.hidx 文件的各个组件的 HIS 运行时使用与后端系统进行通信。通过 Studio 设计器.hidx 文件的创建完全是人工操作。但是,生成的.hidx 文件通过 PowerShell自动化可以节省时间的整个生命周期的项目。累积更新 2 可以创建和修改.hidx 文件通过 PowerShell。
请注意,必须使用 PowerShell 的 32 位版本,因为 32 位 Visual Studio 设计器的组件称为。如果使用 PowerShell 的 64 位版本,则会记录类似于以下内容的错误消息:
Microsoft.HostIntegration.Importer.PowerShell.NewHisWipHidxFile 的类型初始值设定项引发异常。
更多信息
此更新包含主机集成服务器 2016 年累积更新 2中。
可以在 Visual Studio 中创建的主机集成项目的种类如下:
-
BizTalk 管线转换
-
宿主应用程序
-
主机文件
-
消息队列
安装此更新累积修补程序后,您可以通过 PowerShell 这些项目类型中的每个创建.hidx 文件。我们建议您尝试使用 PowerShell 创建该文件之前生成.hidx 文件,Visual Studio 设计器通过一些经验。
若要使用 PowerShell,打开 32 位 Windows PowerShell ISE (x86),,然后在视图菜单上选择显示命令加载项。在命令选项卡上,选择要显示的可用 PowerShell 命令列表的Microsoft.HostIntegration.Importer.PowerShell模块。
示例
若要手动执行下列任务,请执行以下步骤:
-
创建一个 hidx 对象,WIP。
-
添加一个名为GetAccounts的方法。
-
添加输入的 30 字符字符串参数名为客户名称。
-
添加名为允许使用字母输入的 6 个字符的字符串参数。
-
添加名为平衡PIC S9 输出小数参数 (7) V99。
-
将 WIP hidx 对象另存为一个文件。Hidx 文件保存在 C:\Lab。 请注意该文件夹必须存在以便能够创建 $WIPhidx 对象。
若要自动执行这些任务,请继续运行下面的脚本:
$WIPhidx = New-HisWipHidxFile -ElmUserData -Name MyNamespace -Interface IMyInterface -
Description "My Description" -File C:\Lab\WIPSample.hidx
$WIPMethod = Add-HisHidxElement -InputObject $WIPhidx -Method -Name GetAccounts
$NameParameter = $WIPMethod | Add-HisHidxParameter -Name CustomerName -Atomic
$NameParameter.Direction = "In"
$NameParameter.DataType = "String"
$NameParameter.ConversionInformation.Size = 30
$AccountParameter = $WIPMethod | Add-HisHidxParameter -Name AccountNum -Atomic
$AccountParameter.Direction = "In"
$AccountParameter.DataType = "String"
$AccountParameter.ConversionInformation.Size = 6
$BalanceParameter = $WIPMethod | Add-HisHidxParameter -Name Balance -Atomic
$BalanceParameter.Direction = "Out"
$BalanceParameter.DataType = "Decimal"
$BalanceParameter.ConversionInformation.HostDataType = "PIC S9(n)V9(n) COMP-3"
$BalanceParameter.ConversionInformation.Precision = 7
$BalanceParameter.ConversionInformation.Scale = 2
$WIPhidx.Save()
注意:其他示例 PowerShell 脚本是在GitHub上可用。
参考资料
了解 Microsoft 用于描述软件更新的术语。