转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 ...
随机推荐
- 【视频演示】FireBase链接已有应用&实时数据库的配置与使用
全程无编辑,一镜到底,一帧未减,带上犯傻的时间全部不到31分钟:Firebase链接与基础功能使用如此之简单,跟我一起动手,从零开始链接Firebase吧~注意: 输入声源为笔记本自带麦克风,所以风扇 ...
- csv 文件用Excel打开乱码
最近在做一个上传的功能,记录下自己的感受. 刚开始我用的是excel上传:但是发现客户服务器有用64位的,使用的时候程序会报错: 未在本地计算机上注册“Microsoft.Jet.OLEDB.4.0” ...
- 在项目中导入MRC的文件时解决办法
1.由于在项目中要使用到第三方框架和其他的类的时候,而它用的是MRC的时候,其最简便的方法:完成从MRC到ARC的转换. 1.点击工程文件,进入到工程的设置里面. 2.看见Build Phases,就 ...
- h5调用摄像头
<!DOCTYPE html><html lang="zh-CN"><head> <meta charset="UTF-8&qu ...
- Sqlserver 函数(例子)
--SQL SERVER 2008 函数大全/*author:TracyLeecsdncount:Travylee*/ /*一.字符串函数:1.ascii(字符串表达式) 返回字符串中最右侧字符的 ...
- js或jquery如何获取父级、子级、兄弟元素(包括祖级、孙级等)
原生javascript方法: var a = document.getElementById("dom"); del_space(a); //清理空格 var b = a.chi ...
- maven加载jar包配置
maven build时报程序包不存在和找不到符号的错误,但是代码中不报错,如下: [ERROR] Failed to execute goal org.apache.maven.plugins:ma ...
- Ext.Net 学习随笔 003 Panel基本使用
Panel() 1.使用Content和Html属性设置Panel内容 前台View代码 @(X.Panel() .ID("panel1") .Width() .Height() ...
- Chapter 5: Design and implement security
Configure authentication Authenticating users IIS authentication Anonymous ASP.net impersonation Bas ...
- 使用异步I/O大大提高应用程序的性能
转自:https://www.ibm.com/developerworks/cn/linux/l-async/ AIO简介 Linux中最常见的输入输出(I/O)模型是同步I/O.在这个模型中,当请求 ...