我正在尝试从 REST 客户端访问 WCF 服务。我正在从 REST 客户端向 WCF 服务发送 POST 请求。详细如下,供大家参考。
The 服务合同定义如下:
[ServiceContract]
public interface IBZTsoftsensor_WcfService {
[OperationContract]
[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "/data")]
string ExecuteModelJson(string inputModel);
}
而该接口的实现如下:
public string ExecuteModelJson(string inputModel){
try
{
BZTsoftsensor_ModelInput input = JsonConvert.DeserializeObject<BZTsoftsensor_ModelInput>(inputModel);
var results = this.ExecuteModel(input);
return JsonConvert.SerializeObject(results);
}
catch (Exception ex)
{
return ex.Message;
}
}
我从 REST 客户端请求此 WCF 服务,如下所示:
As an extension, I have to access this WCF service from a NiFi processor. Could you please advise me how can I configure a processor in Nifi to access this WCF service? In Nifi processor, there is a POSTHTTP
processor (documentation: https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.standard.PostHTTP/index.html) is available, however I am wondering how could I configure it?
或者可能有其他处理器可供使用invokeHTTP
?? (文档:https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.standard.InvokeHTTP/index.html )
我尝试配置invokeHTTP 处理器。以下是配置参数。但是,我无法访问 WCF 服务。
and more paremeters are as follows: