在 WP7 应用程序中,当 IncomingMessageHeaders 为 null 时访问 WCF SoapHeader
在 Windows Phone 7.5 应用程序中,在对 wcf 服务的调用中,我使用 MessageIncomingHeaders 属性 [下面的代码] 通过我的 OperationContext 检索 Message Soap 标头,但 IncomingMessageHeaders 为 null。 服务响应正常,因为 II 可以访问日志服务器响应。
using (OperationContextScope scope = new OperationContextScope((IContextChannel)client.InnerChannel))
{
MessageHeader myheader = MessageHeader.CreateHeader(....);
OperationContext.Current.OutgoingMessageHeaders.Add(myheader);
client.InfoAsync(request);
client.InfoCompleted += new EventHandler<InfoCompletedEventArgs>(Info_callBack);
}
void Info_callBack(object sender, InfoCompletedEventArgs e)
{
using (OperationContextScope scope = new OperationContextScope((IContextChannel)client.InnerChannel))
{
MessageHeaders headers=OperationContext.Current.IncomingMessageHeaders;
}
.... 如何从响应中检索肥皂头? IncomingMessageHeaders 为空。
In an Windows Phone 7.5 application, In a call to a wcf service I used the MessageIncomingHeaders property [code just below] to retrieve Message Soap Headers with my OperationContext, but the IncomingMessageHeaders is null.
The service response is OK because I I can access the logs server response.
using (OperationContextScope scope = new OperationContextScope((IContextChannel)client.InnerChannel))
{
MessageHeader myheader = MessageHeader.CreateHeader(....);
OperationContext.Current.OutgoingMessageHeaders.Add(myheader);
client.InfoAsync(request);
client.InfoCompleted += new EventHandler<InfoCompletedEventArgs>(Info_callBack);
}
void Info_callBack(object sender, InfoCompletedEventArgs e)
{
using (OperationContextScope scope = new OperationContextScope((IContextChannel)client.InnerChannel))
{
MessageHeaders headers=OperationContext.Current.IncomingMessageHeaders;
}
....
How to retrieve a soap header from a response? IncomingMessageHeaders is null.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论