Web Services 问题
来源:互联网 发布:js禁止页面后退 编辑:程序博客网 时间:2024/06/04 00:26
与第三方交互时,为安全着想,通常使用WebServices + XML方式 进行数据交换与操作的交互;
但是,使用WebService,可能存在着一些问题;
下面是我在编写时,遇到的问题:
1.传送XML标签 ,IIS报错;
图1,接口TransHaltInfo,调用框:<req><Name>LiMing</Name></req>,点“调用”按钮时,
图1
如图2,错误HttpRequestValidationException,这是因为在.net frameword 4.5 中要检验Http请求,发现包含有&,<,>等特殊字串;
图2
解决方法:在 Web.config 文件system.web结点中,添加下面配置即可:
<system.web> <!-- 这里省略部分配置--> <!--设置页面不检测HTML语法--> <httpRuntime requestValidationMode="2.0"/> <pages enableSessionState="true" validateRequest="false"/></system.web>
重新调用,一切OK;
2.“调用"(Invoke)按钮,本地http请求,可以显示,远程http请求,不显示;
本地http请求,如图1所示,可是远程http请求,如图3
图3
发现并没有”调用“按钮(Invoke)
这个按钮主要用于调试,所以默认情况下,远程http请求,不显示;
可以通过配置文件方式,显示该 按钮:
<system.web> <webServices> <protocols> <add name="HttpGet" /> <add name="HttpPost" /> <add name="HttpPostLocalhost" /> <add name="Documentation" /> </protocols> </webServices> </system.web>
0 0
- Web Services 问题
- Web Services 的dataTable问题
- web services 中资源文件的路径问题
- Java Web Services面试问题集锦
- [System.Web.Script.Services.ScriptService]引用问题
- Web Services
- Web Services
- Web Services
- web services
- web services
- Web Services
- Web Services
- web services
- Web Services
- web services
- Web Services
- Web services
- Web Services
- hive安装后测试
- cocos2dx 3.1 实现简单的翻牌效果
- POJ2826-An Easy Problem?!
- 使用python编写android截屏脚本
- Android Fragment 真正的完全解析(下)
- Web Services 问题
- apache 的配置段说明及PHP配置
- shell脚本自动化采集性能sql
- 坚持
- Android Studio如何快速生成get,set,tostring,构造函数
- ThreadLocal分析和研究
- AT指令发送短信流程
- shark-0.9.1 安装后测试
- 反渗透设备:RO双极反渗透设备概述