在调试HTTP的Visual Web Developer Web服务/ 1.1 400错误的请求错误、Web、Visual、HTTP

2023-09-04 22:39:21 作者:就算全世界与我为敌

我已经开发wirh的Visual Web Developer 2010的.NET C#MVC3 Web服务应用程序。    我从一个Android应用程序movile调用Web服务。    我想测试的Web服务,从Eclipse模拟器。    当我从Web浏览器调用该服务,但是当我打电话,然后从Android应用程序中使用模拟器调试Web服务应用程序的一切工作正常Ÿ得到HTTP / 1.1 400错误的请求。

I have an .net c# mvc3 web service application developed wirh visual web developer 2010. I am calling the web services from an android movile application. I want to test the web services, from the eclipse emulator. When i debug the webservice application everything works fine by calling the services from the web browser but when i call then from the android application using the emulator y get "HTTP/1.1 400 Bad Request".

好奇的是,如果我发布了Web服务应用程序在我的本地IIS 7的一切wirks罚款虽然我不能调试服务。

the curious thing is that if i publish the web service application on my local IIS 7 everything wirks fine although i can not debug the service.

在我使用的Visual Web Developer网页显示有这样的联系地址debig服务:

when i debig the service using the visual web developer a web page appear with a adress like that:

的http://本地主机:1627 / myservice.asmx / myMethod的

"http://localhost:1627/myservice.asmx/myMethod"

在我的Andr​​oid应用程序,我调用服务,这样的网址:

On my android application i call the service with a url like that:

http://10.0.2.2:1627/myservice.asmx/myMethod

"http://10.0.2.2:1627/myservice.asmx/myMethod"

但后来我得到HTTP / 1.1 400错误的请求

but then i get the "HTTP/1.1 400 Bad Request"

我真的希望AP preciate任何帮助。

I really would appreciate any help.

感谢。

推荐答案

据Cannot连接通过IP地址ASP.NET开发服务器(VS2010)

ASP.NET开发服务器将成为网页到本地计算机上的浏览器请求。它不会成为页到另一台计算机。此外,它不会成为属于应用范围的文件。 ASP.NET开发服务器提供了一种有效的方法,在本地测试页面,发布页面到生产服务器上运行IIS之前。

The ASP.NET Development Server will serve pages to browser requests on the local computer. It will not serve pages to another computer. Additionally, it will not serve files that are outside of the application scope. The ASP.NET Development Server provides an efficient way to test pages locally before you publish the pages to a production server running IIS.