Web服务代理设置 [英] web service proxy setting

查看:214
本文介绍了Web服务代理设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在c#4.0中,我有一个名为ManufacturerContactDetails的Web服务.我正在使用以下方法从Windows应用程序调用该Web服务:

In c# 4.0, I have a web service called ManufacturerContactDetails. I am calling that web service from a windows app using the following:

var ws = new ManufacturerContactDetailsWebServiceSoapClient();
ContactDetails cd = ws.GetContactDetails("Google");

但是,我想设置肥皂客户端使用的Web代理服务器.我一直在寻找ws.Proxy属性,但它不存在.我不想使用Internet Explorer中的那个.

However, I would like to set the web proxy server that the soap client uses. I've had a look for a ws.Proxy property but it doesn't exist. I don't want to use the one from internet explorer.

如何设置要使用的Web代理服务器?

How do I set the web proxy server to use?

推荐答案

创建包含以下内容的应用配置文件

Create the app config file containing the following

<system.net>
    <defaultProxy useDefaultCredentials="true">
        <proxy usesystemdefault="True" bypassonlocal="True"/>
    </defaultProxy>
</system.net>

此处的更多信息 http://blogs.infosupport.com/blogs/porint/archive/2007/08/14/Configuring-a-proxy_2D00_server-for-WCF.aspx

再见

这篇关于Web服务代理设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆