【发布时间】:2019-05-15 19:12:07
【问题描述】:
我正在尝试覆盖标头以在此 WebService 中调用 push 方法,但定义中不存在 IContextChannel InnerChannel 参数。
我创建了 SecurityHeader 类,如以下链接中文章的响应所示:https://stackoverflow.com/a/16031437/11505984。但我不明白 InnerChannel 是从哪里来的。
try
{
TransmissionService transmission = new TransmissionService();
using (new OperationContextScope(transmission.InnerChannel))
{
OperationContext.Current.OutgoingMessageHeaders.Add(
new SecurityHeader("UsernameToken-8", "12345/userID", "password123"));
transmission.publish(new Transmission());
}
}
catch(Exception e)
{
var message = e.Message;
}
我遇到以下错误:TransmissionService 不包含 InnerChannel 的定义并且没有扩展方法。
谁能解释一下我需要什么?
谢谢
【问题讨论】:
标签: c# .net web-services wsse