转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 ...
随机推荐
- Lua table库整理(v5.1)
这个库提供了表处理的通用函数. 所有函数都放在表 table. 无论何时,若一个操作需要取表的长度, 这张表必须是一个真序列. table.concat(list, [, sep, [, i , [, ...
- VS2010调试C程序,总是一闪而过
今天在vs2010调试C语言程序的时候,一闪而过,百度上搜了三种解决的方法,都是可以用的. 1. #include<iostream> using namespace std; int ...
- LeakCanary Android 和 Java 内存泄露检测。
开始使用 在 build.gradle 中加入引用,不同的编译使用不同的引用: dependencies { debugCompile 'com.squareup.leakcanary:leakcan ...
- jQuery extend方法使用及实现
一.jQuery extend方法介绍 jQuery的API手册中,extend方法挂载在jQuery和jQuery.fn两个不同对象上方法,但在jQuery内部代码实现的是相同的,只是功能却不太一样 ...
- You need to use a Theme.AppCompat theme (or descendant) with this activity
经过本人的经验和在网上查找,有2种方法可以解决. 解决步骤已经写到我的公众号,二维码在下面. 欢迎观看我的CSDN学院课程,地址:http://edu.csdn.net/course/detail/2 ...
- kali linux 安装nvidia
开始安装之前需要说明一下几点: 1.安装闭源显卡驱动有一定风险,比如黑屏或者无法进入图形界面什么的.如果您很害怕折腾,而且不在Linux系统中玩开源游戏(比如Nexuiz)或看高清电影,默认的nouv ...
- UML类图分析
继承: 实现: 关联: 依赖: 组合: 聚合:
- 3、C#入门第3课
1.c#中一个解决方案 里面两个程序 怎么一个启动另一个? 我一个解决方案下,有两个工程,我想让A工程在适当时候,启动B工程,比如A中有个按钮,一点,B工程就启动了. System.Diagnosti ...
- flask请求管道
请求管道,登录前的验证,否则重定向到登录页面. # coding: utf8 from flask import render_template, request, g, session, redir ...
- CPU利用率异常的分析思路和方法交流探讨
CPU利用率异常的分析思路和方法交流探讨在生产运行当中,经常会遇到CPU利用率异常或者不符合预期的情况,此时,往往暗示着系统性能问题.那么究竟是核心应用的问题?是监控工具的问题?还是系统.硬件.网络层 ...