对于想要通过URL地址将数据发送到接收方的传输方式,PI HTTP Receiver Adapter的配置要稍微复杂一点,首先要在Message Mapping的时候将需要通过URL地址传输过去的参数用Dynamic Configuration函数转换一下,如下图:
DynamicConfiguration Function:
public String DynamicConfiguration(String NameSpace, String ParamName, String ParamValue, String Value, Container container) throws StreamTransformationException{
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create(NameSpace,ParamName);
conf.put(key,ParamValue);
return Value;
}
然后在ID中配置HTTP Receiver Channel:在Channel里主要注意以下几个地方:
1、 Content Type使用:application/x-www-form-urlencoded
Adapter-Specific Message Attributes下选中下面三项: