第一次调用Web service响应速度慢的解决办法
Env:
Client: WinForm(Net Framework 2.0)
Server:Web Service(Net Framework 4.0)
Problem:
Client use proxy to invoke a simple method in web services, this method only take a few milliseconds but the first invoke may take more than 10 seconds.
Reason:
The defult proxy was enable by default (if the element is not specified)in configure, so client will wait the default proxy timeout then use the proxy we defined at the first time.
Resolve:
Add the following code in configure:

<system.net>
<defaultProxy enabled="false" useDefaultCredentials="false">
<proxy/>
<bypasslist/>
<module/>
</defaultProxy>
</system.net>

or Add the following code in application:
HttpWebRequest.DefaultWebProxy = null; //========================= WebClient wc = new WebClient();
wc.Proxy = null;
Learn from the following site:
http://blog.csdn.net/rrrfff/article/details/6170653
http://msdn2.microsoft.com/en-us/library/kd3cf2ex(VS.80).aspx
第一次调用Web service响应速度慢的解决办法的更多相关文章
- ORACLE存储过程调用Web Service
1. 概述 最近在ESB项目中,客户在各个系统之间的服务调用大多都是在oracle存储过程中进行的,本文就oracle存储过程调用web service来进行说明.其他主流数据库,比如mysql和sq ...
- delphi调用web service出现 Unable to retrieve the URL endpoint for Service/Port .....
delphi调用web service出现 Unable to retrieve the URL endpoint for Service/Port, 错误截图如下 查了很长时间, 发现在DataM ...
- C#之VS2010ASP.NET页面调用Web Service和winform程序调用Web Service
一:用ASP.NET调用Web Service 打开VS2010,打开“文件-新建-网站”,选择“ASP.NET网站” 选好存储位置,语言后点击确定,进入默认页面.然后先添加Web引用,把WebSer ...
- 基于Web Service的客户端框架搭建一:C#使用Http Post方式传递Json数据字符串调用Web Service
引言 前段时间一直在做一个ERP系统,随着系统功能的完善,客户端(CS模式)变得越来越臃肿.现在想将业务逻辑层以下部分和界面层分离,使用Web Service来做.由于C#中通过直接添加引用的方来调用 ...
- [Teamcenter 2007 开发实战] 调用web service
前言 在TC的服务端开发中, 能够使用gsoap 来调用web service. 怎样使用 gsoap , 參考 gsoap 实现 C/C++ 调用web service 接下来介绍怎样在TC中进行 ...
- ASP.NET4.0中JavaScript脚本调用Web Service 方法
环境:VS2019 .net 4.0 framework 根据教材使用ScriptManager在JavaScript中调用Web service 时,失败.现将过程和解决方法记录如下: 1.定义W ...
- C#开发和调用Web Service
http://blog.csdn.net/h0322/article/details/4776819 1.1.Web Service基本概念 Web Service也叫XML Web Service ...
- php5调用web service
工作中需要用php调用web service接口,对php不熟,上网搜搜,发现关于用php调用web service的文章也不多,不少还是php4里用nusoap这个模块调用的方法,其实php5里已经 ...
- 通过ksoap2-android来调用Web Service操作的实例
import java.io.IOException; import org.ksoap2.SoapEnvelope;import org.ksoap2.serialization.SoapObjec ...
随机推荐
- iOS自动化探索(四)自动化测试框架pytest - 安装和使用
自动化测试框架 - pytest pytest是Python最流行的单元测试框架之一, 帮助更便捷的编写测试脚本, 并支持多种功能复杂的测试场景, 能用来做app测试也能用作函数测试 官方文档: ht ...
- [eShopOnContainers 学习系列] - 01 - Roadmap and Milestones for future releases
https://github.com/dotnet-architecture/eShopOnContainers/wiki/01.-Roadmap-and-Milestones-for-future- ...
- Django的 CBV和FBV
FBV CBV 回顾多重继承和Mixin 回到顶部 FBV FBV(function base views) 就是在视图里使用函数处理请求. 在之前django的学习中,我们一直使用的是这种方式,所以 ...
- NSPredicate(正则表达式)
1. 正则表达式使用单个字符串来描述.匹配一系列符合某个句法规则的字符串.通常被用来检索.替换那些符合某个模式的文本. 2. iOS中正则使用 有三种(NSPredicate, rangeOfStri ...
- Thrift之c++实例
一.c++实例 1.下载与安装thrift工具 http://thrift.apache.org/download/ .服务端代码 1).新建vc工程. 2).将上面的文件拷贝到工程目录下,Test_ ...
- F. Coprime Subsequences
题目链接: F. Coprime Subsequences time limit per test 2 seconds memory limit per test 256 megabytes inpu ...
- canvas 绘制图像
结果: 代码: <!DOCTYPE html> <html> <head lang="en"> <meta charset="U ...
- 【MFC】断言(ASSERT)的用法
摘自:Moondark http://www.cnblogs.com/moondark/archive/2012/03/12/2392315.html 断言(ASSERT)的用法 我一直以为as ...
- java如何获取当前时间,精确到毫秒
import java.text.SimpleDateFormat; import java.util.Date; import java.util.Calendar; //func1 Calenda ...
- 如何将u盘、移动硬盘转化为活动分区--绝招
https://jingyan.baidu.com/article/e75057f2a6a18aebc91a893e.html