从后面代理服务器添加Web服务引用 [英] add web service reference from behind a proxy server

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

问题描述

我使用VS2010。在一个简单的控制台应用程序我尝试将服务引用添加到 HTTP://***/service1.asmx ,旧的asmx服务。
我的电脑是代理服务器的后面,所以我得到一个错误:

I'm using vs2010. In a simple console app I try to add a service reference to http://***/service1.asmx , old asmx service. My computer is behind a proxy server, so i get an error :

远程服务器返回了意外的响应:( 407)代理
需要身份验证。

"The remote server returned an unexpected response: (407) Proxy Authentication Required."

在使用WSDL工具IM我不能定义代理服务器端口号,我也得到消息服务器,对于〔实施例10.0.0.3:80,没有回应,但我需要指定8080端口,不知道怎么办。我怎么可以创建一个参考?

When im using wsdl tool i can not define proxy server port number and i get message that server, for examle 10.0.0.3:80, did not respond, but i need to specify 8080 port and don't know how. How could i create a reference?

推荐答案

看看下面的链接指定的代理服务器地址和服务器端口增加时, 。Web引用

Take a look at the links below for specifying the proxy address and server port when adding a web reference.

的http:// MSDN。 microsoft.com/en-us/library/bb628649.aspx

http://msdn.microsoft.com/en-us/library/03seed2h.aspx

要添加一个引用到ASMX

To add a reference to an asmx


  1. 在控制台应用程序右键单击并选择添加服务引用。

  1. Right click on the console app and select add service reference.

单击高级按钮,并在地址栏输入地址ASMX。点击绿色按钮旁边发现了ASMX。

Click on the advanced button and enter the asmx address in the address bar. Click on the green button next to it to discover the asmx.

给它一个名称,然后单击添加REF。

Give it a name and click on add ref.

更新:尝试更新web配置/应用程序配置和添加;

Update: try updating web config/ app config and add;

<system.net>

<defaultProxy>
<proxy usesystemdefault="True" proxyaddress="http://[your proxy address and port number]"  bypassonlocal="True"/>

</defaultProxy>

</system.net>

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

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