我写了一个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()
大侠们帮我解决一下,谢谢了

解决方案 »

  1.   

    在 <system.web>
     节点下加入    
    <webServices>  
      <protocols>  
      <add name= "HttpPost " />  
      <add name= "HttpGet " />  
      </protocols>  
    </webServices>
      

  2.   

     要在webservice的web.config文件中的 <system.web> 节点下加入<webServices> 
    <protocols> 
    <add name= "HttpPost " /> 
    <add name= "HttpGet " /> 
    </protocols> 
    </webServices>
      

  3.   

    添加了
    <protocols> 
        <add name= "HttpPost " /> 
         <add name= "HttpGet " /> 
    </protocols>  不过要注意 下面的<remove name ="Documention"/> 这个要去掉。这个我说在配置VSS internet时出现的问题。