简体   繁体   English

在 web 场中找到哪个服务器执行了 web 方法?

[英]find which server in a web farm the web method got executed?

This question is a consequence of the following question: determining which server (in a web farm) the asp.net ajax request came from?这个问题是以下问题的结果: 确定 asp.net ajax 请求来自哪个服务器(在 web 场中)?

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).问题是我们通常使用自动生成的代理类与 web 方法(可能是 asmx/wcf 服务的一部分)进行通信。 When we receive the response from the web services server, how do we know which server it got processed from?当我们收到来自 web 服务服务器的响应时,我们如何知道它是从哪个服务器处理的?

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.当它是一个脚本服务(可以通过javascript调用)时,它完全是另一种情况。

How can we read the response headers once the web service returns?一旦 web 服务返回,我们如何读取响应头?

Am I constrained to build my own proxy classes to solve this problem?我是否必须构建自己的代理类来解决这个问题?

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.如果您有 fiddler/burp 之类的工具,则可以检查响应标头。 So we must configure the IIS to set the response headers appropriately.所以我们必须配置 IIS 来适当地设置响应头。

By default they are configured to output something like X-ASP.NET...a good idea would be to add the server name to that...默认情况下,它们被配置为 output 之类的 X-ASP.NET ......一个好主意是添加服务器名称......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM