请求以HTTP状态400失败:错误请求(数据无效):代码库工作在一台机器上,而不是另一台机器上

时间:2021-12-20 15:24:18

This will probably be an environmental issue but I'm stumped as where to start.

这可能是一个环境问题,但我不知道从哪里开始。

I'm attempting to call a a webservice on an external server in an asp.net web app while debugging in VS2008. The exact same code/project works on one machine calling the server but on another machine (my new one) it fails with the 400 Bad request (data is invalid) error.

在VS2008中调试时,我尝试在asp.net web应用程序的外部服务器上调用一个webservice。相同的代码/项目在一台调用服务器的机器上工作,但是在另一台机器上(我的新机器),由于400个错误请求(数据无效)而失败。

Both machines are running Windows 7. What should I be looking for as differences in the two machines that could be contributing to this problem?

这两台机器都在运行Windows 7。我应该在这两台机器中寻找可能导致这个问题的不同之处?

Edit Deleting the webreference in the project and re-creating the webreference had no effect

编辑删除项目中的webreference,并重新创建webreference没有任何效果

Update

更新

I went to use Fidler2 to inpect the request and response which resulted in the error going away. Things are beginning to point to an internet proxy issue.

我使用Fidler2对请求和响应进行检查,结果错误消失了。事情开始指向互联网代理问题。

1 个解决方案

#1


3  

It's an Internet Proxy issue. The suspect machine had be configured to manually use a proxy server. Turning this off: Control Panel -> Internet Options -> Connections Tab -> Lan Settings Button, and enabling "Automatically detect settings" has fixed the problem.

这是一个互联网代理问题。被怀疑的机器被配置为手动使用代理服务器。关闭此选项:控制面板-> Internet选项-> Connections选项卡-> Lan设置按钮,启用“自动检测设置”解决了这个问题。

#1


3  

It's an Internet Proxy issue. The suspect machine had be configured to manually use a proxy server. Turning this off: Control Panel -> Internet Options -> Connections Tab -> Lan Settings Button, and enabling "Automatically detect settings" has fixed the problem.

这是一个互联网代理问题。被怀疑的机器被配置为手动使用代理服务器。关闭此选项:控制面板-> Internet选项-> Connections选项卡-> Lan设置按钮,启用“自动检测设置”解决了这个问题。