转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 ...
随机推荐
- CLR via C# 3rd - 03 - Shared Assemblies and Strongly Named Assemblies
1. Weakly Named Assembly vs Strong Named Assembly Weakly named assemblies and strongly named ...
- Less函数说明
索引 escape(@string); // 通过 URL-encoding 编码字符串 e(@string); // 对字符串转义 %(@string, values...); // 格式化字符串 ...
- CSS hack方式一览【转】
做前端多年,虽然不是经常需要hack,但是我们经常会遇到各浏览器表现不一致的情况.基于此,某些情况我们会极不情愿的使用这个不太友好的方式来达到大家要求的页面表现.我个人是不太推荐使用hack的,要知道 ...
- Angularjs scope
$scope: var myapp = angular.module('myapp', []); myapp .controller('parent', function ($scope,$timeo ...
- POJ 3009 DFS+剪枝
POJ3009 DFS+剪枝 原题: Curling 2.0 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 16280 Acce ...
- webpack使用tree shaking的问题。及关于UglifyJs不支持ES6的解决方案。
webpack: plugins:[ new webpack.optimize.UglifyJsPlugin({ compress:{warning:true} }) ] 是的,一些dead code ...
- 第四篇T语言实例开发,自动加血
游戏自动加血 基础知识复习 通过前面的学习了解以下内容: TC软件的基本使用 TC的基础语法 变量与常量 功能的使用 流程语句的使用 线程的基本使用 TC控件的基本使用 热键和按钮的事件功能 控件的数 ...
- hiho一下18周 RMQ问题再临
RMQ问题再临 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 终于,小Hi和小Ho踏上了回国的旅程.在飞机上,望着采购来的特产--小Hi陷入了沉思:还记得在上上周他们去 ...
- BZOJ 1303 CQOI2009 中位数图 水题
1303: [CQOI2009]中位数图 Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 2340 Solved: 1464[Submit][Statu ...
- [THINKING IN JAVA]初始化和清理
4.5初始化和清理 5.1 构造器初始化 无参:如果一个类没有构造器,那么会有一个默认的无参构造器,并且只能通过无参构造器初始化对象: 带参:传入参数初始化成员变量或者其它初始化操作需要的参数,如果类 ...