服务器端重定向截断请求负载

发布于 2024-12-17 11:24:28 字数 772 浏览 1 评论 0原文

我使用的是 IIS 6,并且有一个 ASP.Net 4.0 站点,该站点是一个用作 SOAP 反向代理的单个页面。我必须修改返回内容,以便从响应中删除故障节点并添加跟踪节点。

为了促进其作为所有地址的反向代理的功能,我将服务器上的 404 设置为“/default.aspx”(我的应用程序的页面)的自定义“URL”

对于没有有效负载的请求,它可以工作完美 - 例如 ?WSDL URL。它从目标系统请求正确的 URL,获取响应并将其发回 - 在这方面它是完全透明的。

但是,当使用输入有效负载发出 SOAP 请求时,代码中的 Request.InputStream 始终为空。空 - 除了一个例外 - 使用 SOAPUI,我可以覆盖端点并将请求直接发送到 /default.aspx,它将接收输入有效负载。因此,我确定自定义 404 处理程序在服务器端传输请求时会剥离有效负载。我知道有效负载正在发送 - 我什至已经在服务器上对它进行了wireshark以确保这一点。但是,当我添加代码来记录 Request.InputStream 的内容时,它是空白的 - 即使 Request.ContentLength 显示原始请求的正确内容长度。

我也一直在寻找一种使用 ASP.Net 直接拦截请求的好方法,而不是让普通的 IIS 404 处理程序来处理它,但即使使用通配符映射,我似乎也无法获得正确的设置我也不完全相信这会有所帮助。 (但我希望会这样?)

最后,我没有安装 MVC 框架的公司许可。

因此,我需要对 IIS 进行一些配置才能使其正常工作,或者需要一些其他方法来确保我将请求有效负载发送到我的网页。

谢谢!

I'm on IIS 6 and I have an ASP.Net 4.0 site that's a single page to serve as a SOAP reverse proxy. I have to modify the return content in order to delete a trouble node from the response and add a tracking node.

In order to facilitate its function as a reverse proxy for all addresses, I have the 404 on the server set to a custom "URL" of "/default.aspx" (the page for my app)

For requests without a payload, it works perfectly - such as for ?WSDL Urls. It requests the proper URL from the target system, gets the response and sends it back - it's pretty utterly transparent in this regard.

However, when a SOAP request is being made with an input payload, the Request.InputStream in the code is always empty. Empty - with one exception - using SOAPUI, I can override the end point and send the request directly to /default.aspx and it will receive the input payload. Thus, I have determined that the custom 404 handler is - when server-side transferring the request - stripping the payload. I know the payload is being sent - I have even wiresharked it on the server to be sure. But then when I add code to log the contents of Request.InputStream it's blank - even though Request.ContentLength shows the right content length for the original request.

I've also been looking for a good way to use ASP.Net to intercept the requests directly rather than allowing the normal IIS 404 handler to take care of it but even with a wildcard mapping, I can't seem to get the settings right nor am I fully confident that it would help. (But I'm hoping it would?)

Finally, I don't have corporate permission to install MVC framework.

Thus, I need either some configuration for IIS I am missing to make this work properly or some other method of ensuring that I get the request payload to my web page.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蓝颜夕 2024-12-24 11:24:29

使用映射到所有请求的 HTTP 处理程序怎么样?

您需要添加 a通配符应用程序映射详见此处并且正确配置您的 HTTP 处理程序

What about using an HTTP Handler mapped to all requests?

You'll need to add a wildcard application mapping as detailed here and correctly configure your HTTP Handler.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文