查找 Web 场中的哪台服务器执行了 Web 方法?
这个问题是以下问题的结果: 确定asp.net ajax请求来自哪台服务器(在网络场中)?
问题是我们通常使用自动生成的代理类来与Web方法进行通信(这可能是的asmx/wcf 服务)。当我们收到来自 Web 服务服务器的响应时,我们如何知道它是从哪个服务器处理的?
我们从正在执行的服务器端代码(大部分)接收响应。当它是一个脚本服务(可以通过 javascript 调用)时,则完全是另一种情况。
Web 服务返回后,我们如何读取响应标头?
我是否必须构建自己的代理类来解决这个问题?
This question is a consequence of the following question: determining which server (in a web farm) the asp.net ajax request came from?
The problem is that we commonly use automatically generated proxy classes to communicate with the web method (which may be part of asmx/wcf service). When we receive the response from the web services server, how do we know which server it got processed from?
We receive the response from the server side code which is executing (mostly). When its a script service (which can be called via javascript) its another case altogether.
How can we read the response headers once the web service returns?
Am I constrained to build my own proxy classes to solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
单程。这不是最好的方法,但在新事物出现之前它会一直有效。如果您有像 fiddler/burp 这样的工具,您可以检查响应标头。因此,我们必须配置 IIS 以适当地设置响应标头。
默认情况下,它们配置为输出类似 X-ASP.NET 的内容...一个好主意是将服务器名称添加到其中...
One way. Its not the best way but it will do until something new comes about. If you have a tool like fiddler/burp, you can inspect the response headers. So we must configure the IIS to set the response headers appropriately.
By default they are configured to output something like X-ASP.NET...a good idea would be to add the server name to that...