高分求助:调用webservice出现 “HTTP status 400: Bad Request”

monkchen 2006-12-29 10:53:51
本人作的一个asp.net程序,调用自己的webservice; 在本机正常;迁移到服务器上后,调用webservice时发生异常:

//---------------------------------------------------------------------
Server Error in '/App' Application.
--------------------------------------------------------------------------------

The request failed with HTTP status 400: Bad Request.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.WebException: The request failed with HTTP status 400: Bad Request.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[WebException: The request failed with HTTP status 400: Bad Request.]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +1358
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +205
EduService.TCYWEDUService.CheckValidUser(Int32 pUserType, String pUserName, String pPassword) +95
_Default.Login1_Authenticate(Object sender, AuthenticateEventArgs e) +118
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +105
System.Web.UI.WebControls.Login.AttemptLogin() +106
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +165
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5609




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42



注:因服务器上有一另外一网站独占80端口,所以我的程序使用8080端口,但在我本机也是设置8080端口的,没有问题。

google搜了很多结果出来,可能是受台湾地震影响,就是没一个页面能访问。百度没有,csdn全文检索也没有满意的答案。劳烦有解决方案的兄台赐教!
...全文
2908 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
monkchen 2007-01-02
  • 打赏
  • 举报
回复
正如cpp2017(幕白兄)所言,是webservice路径的问题, 我用wsdl生成了webservice.cs代理类的声明文件,在其构造函数中加入this.url=..... 来明确指出webserivce的url,成功!
monkchen 2006-12-31
  • 打赏
  • 举报
回复
我只在本机试了, 目标服务器在学校,今天那的负责人没在,没法操作,呵呵,明天早上才能去,不好意思!
lxmfll2000 2006-12-30
  • 打赏
  • 举报
回复
解决没有,把结果发出来呗!
monkchen 2006-12-29
  • 打赏
  • 举报
回复
找到了,http://topic.csdn.net/t/20030105/23/1329485.html 我先试试
monkchen 2006-12-29
  • 打赏
  • 举报
回复
谢谢cpp2017(幕白兄) ,请问具体是哪个节点?
cpp2017 2006-12-29
  • 打赏
  • 举报
回复
你的webservice是动态url吧?web.config中的url修改正确了没?
cpp2017 2006-12-29
  • 打赏
  • 举报
回复
400一般是指文件不存在.

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧