.asmx支持post请求或者get请求调用(WebService "因 URL 意外地以 结束,请求格式无法识别" 的解决方法)
使用Post调用以asmx形式提供的webservice时,在本机调试没有调用问题。一旦部署至服务器后会提示如下信息:
<html>
<head>
<title>因 URL 意外地以“/GetCertByToken”结束,请求格式无法识别。</title>
<meta name="viewport" content="width=device-width" />
<style>
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Consolas","Lucida Console",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
@media screen and (max-width: 639px) {
pre { width: 440px; overflow: auto; white-space: pre-wrap; word-wrap: break-word; }
}
@media screen and (max-width: 479px) {
pre { width: 280px; }
}
</style>
</head> <body bgcolor="white"> <span><H1>“/”应用程序中的服务器错误。<hr width=100% size=1 color=silver></H1> <h2> <i>因 URL 意外地以“/GetCertByToken”结束,请求格式无法识别。</i> </h2></span> <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "> <b> 说明: </b>执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 <br><br> <b> 异常详细信息: </b>System.InvalidOperationException: 因 URL 意外地以“/GetCertByToken”结束,请求格式无法识别。<br><br> <b>源错误:</b> <br><br> <table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code> 执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。</code> </td>
</tr>
</table> <br> <b>堆栈跟踪:</b> <br><br> <table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code><pre> [InvalidOperationException: 因 URL 意外地以“/GetCertByToken”结束,请求格式无法识别。]
System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +675
System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +259
System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) +81
System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +375
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +128
</pre></code> </td>
</tr>
</table> <br> <hr width=100% size=1 color=silver> <b>版本信息:</b> Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.7.3282.0 </font> </body>
</html>
解决方案:
修改web.config文件,增加如下内容即可。
<system.web>
<webServices>
<protocols>
<add name="HttpGet" />
<add name="HttpPost" />
<add name="Unknown" />
<add name="HttpSoap" />
</protocols>
</webServices>
</system.web>
.asmx支持post请求或者get请求调用(WebService "因 URL 意外地以 结束,请求格式无法识别" 的解决方法)的更多相关文章
- WebService "因 URL 意外地以 结束,请求格式无法识别" 的解决方法
最近在做一个图片上传的功能,js调用用webservice进行异步访问服务器,对于不是经常用webservice的菜鸟来说,经常会遇到以下的问题(起码我是遇到了) 在页面上写了js调用代码如下所示: ...
- (转)jdbc 调用 sql server 的存储过程时“该语句没有返回结果集”的解决方法
本文转载自:http://hedyn.iteye.com/blog/856040 在JDBC中调用SQL Server中的存储过程时出现如下异常: com.microsoft.sqlserver.jd ...
- 使用layui异步请求上传图片在tp5.1环境下出现“请对上传接口返回json”的错误的解决方法
正常情况下返回json数据使用return json(); 但是使用layui会报错,然后想到了使用json_encode()包装一下用一个变量接收后,再使用return();返回接收json格式的变 ...
- Java调用存储过程时报 The user specified as a definer ('root'@'%') does not exist 解决方法
Caused by: java.sql.SQLException: The user specified as a definer (''@'') does not exist at c ...
- SQLServer调WebService & 错误解决:请求格式无法识别
(sqlServer 2008 + VS2010) 首先,对服务器进行配置. sp_configure ; GO RECONFIGURE; GO sp_configure ; GO RECONFIGU ...
- Android 调用webservice并解析
这是调用webService的具体方法 private final static String nameSpace="http://tempuri.org/"; private f ...
- ASP.NET实现二维码 ASP.Net上传文件 SQL基础语法 C# 动态创建数据库三(MySQL) Net Core 实现谷歌翻译ApI 免费版 C#发布和调试WebService ajax调用WebService实现数据库操作 C# 实体类转json数据过滤掉字段为null的字段
ASP.NET实现二维码 using System;using System.Collections.Generic;using System.Drawing;using System.Linq;us ...
- cxf 和 httpclient 客户端调用 webservice 接口
一.cxf 生成 webservice 客户端 1.接口路径 http://ws.webxml.com.cn/WebServices/WeatherWS.asmx 2.进入你需要放置 webservi ...
- Java动态调用webService,axis2动态调用webService
Java动态调用webService axis2动态调用webService >>>>>>>>>>>>>>>& ...
随机推荐
- mysql学习基础知识3
1.视图 简化sql语句的编写,限制可以查看的数据 一张虚拟的表,不占任何内存,查视图时都是临时从所查的表中拿数据 特点: 对于视图的增删改查 都会同步到原始表 对原始表的修改,会同步到视图内可查看的 ...
- <div>标签仿<textarea>。contentEditable=‘true’,赋予非表单标签内容可以编辑
需求:web页面需要一个文本输入框.1.该文本输入框默认状态下有个仿‘placeholder’的默认文本提示信息,2.文本框输入状态下其高度会随文本内容自动撑开. 方案选择:1.使用<texta ...
- 把xlsx变成CSV
import pandas as pd import numpy as np import matplotlib.pyplot as plt #df.to_excel('C:/Users/Asus/D ...
- fiddler和手机连接抓包实现
很好用的抓包工具,不需要手机usb连接就可以抓包,查找bug超方便 实现方法: 借鉴跳转 手机版本:andriod 7.1.1 上面的方法的基础上遇到的问题: 在浏览器下载下来证书后始终无法打开(或许 ...
- uboot2012(一)分析重定位
目录 引入 环境配置 编译体验 入口查找 代码分析 board_init_f pie 内存分布分析 SP设置 board_init_f 重定位 代码段重定位实现 变量地址修改 参考 title: ub ...
- 【SQL】ROW_NUMBER() OVER(partition by 分组列 order by 排序列)用法详解+经典实例
#用法说明 select row_number() over(partition by A order by B ) as rowIndex from table A :为分组字段 B:为分组后的排序 ...
- Flink 核心技术浅析(整理版)
1. Flink简介 Apache Flink是一个面向分布式数据流处理和批量数据处理的开源计算平台,它能够基于同一个Flink流执行引擎(streaming dataflow engine),提供支 ...
- python 正则指北之我的总结
本文经本人搜索网络加上个人理解整理而成,如有侵权,请告知,会立即删除! 正则引擎大体上可分为不同的两类:DFA和NFA,而NFA又基本上可以分为传统型NFA和POSIX NFA. DFA Determ ...
- 一个关于kindle固件修改的问题
手头有一个序列号为B05A开头的日版kpw2,默认没有中文界面.之前看过@5201992318q 大神的帖子,原因是系统langpicker.conf文件中有一段判断序列号并删除语言的代码,于是我萌发 ...
- Debian Security Advisory DSA-4419-1 twig security update
Package : twigCVE ID : CVE-2019-9942 Fabien Potencier discovered that twig, a templat ...