I am using .net core 3.0 and consuming WCF service in my application and getting error message when Using(OperationContextScope scope = new OperationContextScope(client.InnerChannel)) gets executed
Try
{
using(OperationContextScope scope = new OperationContextScope(client.InnerChannel))
{
HttpRequestMessageProperty httpRequestMessage = new HttpRequestMessageProperty();
httpRequestMessage.Headers.Add("apikey", apikey);
OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = httpRequestMessage;
await client.OpenAsync();
var result2 = await client.ProcessRequestAsync(reqedata, partner);
var data = result2;
}
}
catch(Exception e)
{
throw;
}
I do not understand why I am getting this error. Can please anyone help me with this?