当前位置:编程学习 > C#/ASP.NET >>

因 URL 意外地以“/ReturnABRestulr”结束,请求格式无法识别。

我写了一个webService服务的小程序,程序在VS下运行成功了。可是到IIS上发布的时候出现这样一个错误


“/demoService”应用程序中的服务器错误。

因 URL 意外地以“/ReturnABRestulr”结束,请求格式无法识别。

说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.InvalidOperationException: 因 URL 意外地以“/ReturnABRestulr”结束,请求格式无法识别。

源错误: 

执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。

堆栈跟踪: 


[InvalidOperationException: 因 URL 意外地以“/ReturnABRestulr”结束,请求格式无法识别。]
   System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +518909
   System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +212
   System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) +47
   System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +203
   System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +128
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184



别人说在webservice的 <system.web> 节点下加入  
  <webServices>  
  <protocols>  
  <add name= "HttpPost"/>  
  <add name= "HttpGet"/>  
  </protocols>  
</webServices> 就行了,可是这样又出现了另一个错误
System.InvalidOperationException: 缺少参数: a。
   在 System.Web.Services.Protocols.ValueCollectionParameterReader.Read(NameValueCollection collection)
   在 System.Web.Services.Protocols.UrlParameterReader.Read(HttpRequest request)
   在 System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
   在 System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()


大侠们帮我解决一下,谢谢了
--------------------编程问答-------------------- 同样的错误= = --------------------编程问答-------------------- 在 <system.web>
 节点下加入    
<webServices>  
  <protocols>  
  <add name= "HttpPost " />  
  <add name= "HttpGet " />  
  </protocols>  
</webServices>

--------------------编程问答-------------------- --------------------编程问答-------------------- 问题解决 --------------------编程问答-------------------- 请问怎么解决的?速回答 谢谢 --------------------编程问答-------------------- 怎么解决的呢?? --------------------编程问答--------------------  要在webservice的web.config文件中的 <system.web> 节点下加入<webServices> 
<protocols> 
<add name= "HttpPost " /> 
<add name= "HttpGet " /> 
</protocols> 
</webServices>
--------------------编程问答-------------------- 添加了
<protocols> 
    <add name= "HttpPost " /> 
     <add name= "HttpGet " /> 
</protocols>  不过要注意 下面的<remove name ="Documention"/> 这个要去掉。这个我说在配置VSS internet时出现的问题。
--------------------编程问答-------------------- 我也遇到该问题,找了好几天资料,不能解决,请问楼主是怎么解决的?+Q79611124不胜感激,谢谢 --------------------编程问答-------------------- 解决了就结贴吧 --------------------编程问答-------------------- 加了还是没反映.....
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,