欢迎使用普元产品知识库,本知识库包含普元应用开发平台EOSPlatform,流程平台BPS,企业服务总线ESB,微服务平台Microservice,运维管理平台Devops,数据集成平台DI
欢迎使用普元文档库
本文介绍在EOS Platform7产品版本中,如何使用EOS构件库中流程的服务构件,或者通过API的方式远程调用BPS服务。
有两台机器,一台机器安装EOS7版本或者EOS Platform7版本,假设为a机器;另外一台机器安装BPS企业版、嵌入式或者Platform7版本,假设为b机器。
用户场景:
场景1:通过a机器的逻辑流访问b机器的BPS服务
实现方案:
其中,主机IP,端口号,WEB上下文的根路径是远程流程引擎对应的信息。
说明:通过governor注册的两个服务被保存在eos_service_endpoint表中。
修改a机器的user_local_config.xml([安装后目录]\apps_config\default\config目录):
修改DefaultAppName为在Governor中注册的逻辑名,这里对应第一步中的"other";
修改ServiceLocateMode为 "UDDI_LOCAL"
示例:
<module name="DistributeRuntime">
<group name="DistributeMode"> <configValue key="DefaultAppName">other</configValue> <configValue key="ServerIp">127.0.0.1</configValue> <configValue key="ServerPort">6199</configValue> <configValue key="ServerAppName">default</configValue> <!-- LOCAL_UDDI UDDI_LOCAL UDDI --> UDDI_LOCAL
打开b机器的user_local_config.xml([安装后目录]\apps_config\default\config目录),检查下面的配置:
<group name="http">
<configValue key="needAuthention">true</configValue>
<configValue key="user"><span style="color: #ff0000"><strong>bps</strong></span></configValue>
<configValue key="password"><span style="color: #ff0000"><strong>
fKyjErYbL9XyLCcbvEV/kJ4=</strong></span></configValue>
</group>
"needAuthention"为true,表示打开了http安全控制,还需要把口令存放在a机器的本地配置文件user-local-config.xml中;如果为false,不需要下面的配置:
<module name="ChannelsSecurity">
<group name="channels2">
<configValue key="protocol">http</configValue>
<configValue key="ip">172.16.55.143</configValue>
<configValue key="port">8080</configValue>
<configValue key="webContext">default</configValue>
<configValue key="user"><span style="color: #ff0000"><strong>bps</strong></span></configValue>
<configValue key="password"><span style="color: #ff0000"><strong>
fKyjErYbL9XyLCcbvEV/kJ4=</strong></span></configValue>
</group>
</module>
其中password可以写明文,EOS Server会自动加密。
场景2:通过a机器的Java,即以API的方式调用b机器的BPS服务
实现方案:
开发期访问:需要配置uddi-address.xml文件,可将其创建在EOS项目中任意一个构件包的运算—Java下面,如下图所示:
内容参考如下:
<uddi_address_list>
<name>other</name>
<logicName>default</logicName>
<type>remote</type>
<description>
</description>
<uddiHost>172.16.55.143</uddiHost>
<uddiPassword>000000</uddiPassword>
<uddiWebContext>default</uddiWebContext>
<span style="color: #008080"></</span><span style="color: #3f7f7f">uddi__address</span><span style="color: #008080">></span>
<span style="color: #008080"></</span><span style="color: #3f7f7f">uddi_<em>address</em>_list</span><span style="color: #008080">></span>
其中,uddiUserID,uddiPassword要与b机器的user_local_config.xml([安装后目录]\apps_config\default\config目录)中下面的user,password配置一致:
<group name="http">
<configValue key="needAuthention">true</configValue>
<configValue key="user"><span style="color: #ff0000"><strong>bps</strong></span></configValue>
<configValue key="password"><span style="color: #ff0000"><strong>
fKyjErYbL9XyLCcbvEV/kJ4=</strong></span></configValue>
<span style="color: #333333"></group></span>
如果"needAuthention"为false,uddiUserID,uddiPassword无需配置。
运行期访问:需要配置uddi-address.xml文件,并将之拷贝到WEB-INF/classes目录 。
<span style="color: #ff0000"><strong>注意:</strong></span>EOS Platform7的SEE系统中流程默认客户端代码有一些功能是通过API的方式调用BPS服务,所以如果要用这部分功能,以上两个场景都要配置。而且uddi-address.xml中id一定要设置成default:<span style="color: #008080"><</span><span style="color: #3f7f7f">uddi__address</span> <span style="color: #7f007f">id</span>=<span style="color: #2a00ff"><em>"default"</em></span><span style="color: #008080">></span>。