转WCF Proxy Authentication Required
WCF Proxy Authentication Required
The Problem
When I’m in the office, I have to use an authenticated proxy to get outside our intranet and to the internet. When I called a service that resides on the web, I got the 407 error. How can we fix this without having to provide an account to our application?
The Solution
The answer is actually pretty simple. The answer has nothing to do with WCF, but everything to do with System.Net.
System.Net’s default web proxy does not have the UseDefaultCredentials flag switched on by default. It’s false. Creating a new WebProxy object with the flag set to true is problematical… it turns out to be quite hard to find out the address and port of the default web proxy at runtime, because this is essentially a dynamic thing, and not (as previously thought in the .NET 1.x era) a static thing.
So by far the best thing to do is use your app’s App.Config file to tell System.Net to use the default credentials for authentication to an HTTP proxy server. Something like this:
<system.net>
<defaultProxy useDefaultCredentials="true">
<proxy autoDetect="True"/>
</defaultProxy>
</system.net>
转WCF Proxy Authentication Required的更多相关文章
- Tunnel connection failed: 407 Proxy Authentication Required
报错信息 : Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connecti ...
- C# 调用 Web Service 时出现 : 407 Proxy Authentication Required错误的解决办法
// 记得 using System.Net; System.Net.WebProxy myProxy = new System.Net.WebProxy("localhost:9099&q ...
- PowerShell (407) Proxy Authentication Required
$Client = New-Object -TypeName System.Net.WebClient $Client.Proxy.Credentials = [System.Net.Credenti ...
- HttpWebRequest WebExcepton: The remote server returned an error: (407) Proxy Authentication Required.
1. Supply the credentials of the Currently Logged on User to the Proxy object similar to this: // Be ...
- Redis服务停止报错解决方案[NOAUTH Authentication required]
Redis服务器设置密码后,使用service redis stop 会出现以下信息: service redis stop Stopping ... OK (error) NOAUTH Authen ...
- jenkins 安装 SVN Publisher 后向 svn 提交代码报错: E170001: Authentication required for...
问题描写叙述 安装并启动 jenkins 后,加入了 SVN Publisher 插件,然后在构建任务的"构建后操作"操作中加入了"Publish to Subversi ...
- Jedis异常解决:NOAUTH Authentication required
引言 之前项目能够正常运行,因为默认选择db0,后来新的需求来了,不是默认db0,而是给参数选择db. 修改后代码如下,却报错NOAUTH Authentication required. 解决方法 ...
- redis 执行操作时提示(error) NOAUTH Authentication required.
(error) NOAUTH Authentication required. 出现认证问题,设置了认证密码,输入密码即可 127.0.0.1:6379> auth 123456
- REdis MASTER aborted replication NOAUTH Authentication required
对于REdis集群,如果设置了requirepass,则一定要设置masterauth,否则从节点无法正常工作,查看从节点日志可以看到哪下内容:19213:S 22 Apr 2019 10:52:17 ...
随机推荐
- The requested operation has failed apache
在安装apache后, 启动apache时提示The requested operation has failed错误: 通过一排除 cd apache 安装的Bin目录cmd如下秘密(双引号中的内容 ...
- 前端构建工具gulp入门教程(share)
参考自:http://segmentfault.com/a/1190000000372547 资源: npm上得gulp组件 gulp的Github主页 官方package.json文档 gulp中文 ...
- mysql 联合索引和唯一索引
一般来说.如果有where a=? and b=? and c=? 的语句. 如果表也有DML, 我一般只在a 上建索引. 这也是代价平衡的结果. 一方面 只在a 上建索引那么是 index ran ...
- 如何在Jenkins CI 里调试
背景 厂内的CI系统把 Jenkins 和Github 连接了起来,这样Dev 只要通过github pr 就能够了解到测试job 运行的情况.有的时候,Dev会找到QA问,如何在Jenkins CI ...
- 全面解析sizeof(下) 分类: C/C++ StudyNotes 2015-06-15 10:45 263人阅读 评论(0) 收藏
以下代码使用平台是Windows7 64bits+VS2012. sizeof作用于基本数据类型,在特定的平台和特定的编译中,结果是确定的,如果使用sizeof计算构造类型:结构体.联合体和类的大小时 ...
- oracle中的rownum
1.oracle存在rownum关键字,它是一个伪列(系统分配在结果集上的一个特殊列) SELECT * FROM oracleTable WHERE ROWNUM=1 上面这条语句是能够查询出第一 ...
- oracle数据库从入门到精通
oracle产品线围绕企业开发平台的企业开发平台四大组件:unix,weblogic中间件,java编程语言,oracle数据库oracle 开发主要分两类数据库管理:dba数据库编程:分两部分 ...
- windows开机记录查询
http://jingyan.baidu.com/article/3d69c5516b9a9ef0cf02d7f3.html
- php自学提升进阶路线
为了自己对php的系统全面深入的掌握,我通过个人经验,以及搜索网上高手经验,汇总了一份php自我学习路线规划,包括实战演练.学习建议.高手进阶.常见问题和测试总结五块.算是一个系统的学习计划和目标吧. ...
- time 模块
import time导入时间模块print(time.strftime("%Y-%m-%d %X"))其中 time.strftime("Y-%m-%d")输 ...