WS寻址字段 [英] WS Addressing To and From Fields

查看:68
本文介绍了WS寻址字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将同步响应上的wsa:To和wsa:From字段更改为请求?如果是这样,那怎么做?

is it possible to change the wsa:To and wsa:From fields on the sync response to a request? If so, how is that done?

推荐答案

可以通过编程,在自定义行为中的ClientRuntime上设置Via.这使POST与由于我对WSHttpBinding的使用而自动设置的实际端点地址有所不同.

Programatically, I can set the Via on the ClientRuntime inside the custom behavior. This allows the POST to differ from the actual endpoint address that gets set automatically due to my usage of WSHttpBinding.

public void ApplyClientBehavior
    (ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
    CustomMessageInspector inspector = new CustomMessageInspector();
    clientRuntime.MessageInspectors.Add(inspector);
    clientRuntime.Via = new Uri("http://gatewayRouter/routingService");
}


这篇关于WS寻址字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆