.net HTTPS-需要407代理身份验证

.net HTTPS-需要407代理身份验证,.net,web-services,https,proxy,httpwebrequest,.net,Web Services,Https,Proxy,Httpwebrequest,我正在使用下面的代码给我的合作伙伴webservice打电话。这段代码运行良好,能够从开发环境中的合作伙伴那里提取xml消息。但是,当我将此代码移动到集成环境时,它给出了一个错误407所需的代理身份验证。当我联系我的网络团队时,他们说,我的代码试图通过代理服务器调用 但是,根据下面的代码,我没有配置任何东西来通过代理服务器调用合作伙伴服务。你能建议一下我能做什么吗 NetworkCredential creds = new NetworkCredential(); creds.UserName

我正在使用下面的代码给我的合作伙伴webservice打电话。这段代码运行良好,能够从开发环境中的合作伙伴那里提取xml消息。但是,当我将此代码移动到集成环境时,它给出了一个错误407所需的代理身份验证。当我联系我的网络团队时,他们说,我的代码试图通过代理服务器调用

但是,根据下面的代码,我没有配置任何东西来通过代理服务器调用合作伙伴服务。你能建议一下我能做什么吗

NetworkCredential creds = new NetworkCredential();

creds.UserName = "partner_client";
creds.Password = "dfasnc9d3";
HttpWebRequest hwRequest = (HttpWebRequest)HttpWebRequest.Create("https://res.dfadator.com/rest/requests/recent");
hwRequest.ContentType = System.Configuration.ConfigurationManager.AppSettings.Get("ContentType");
hwRequest.Method = System.Configuration.ConfigurationManager.AppSettings.Get("Method"); ;

hwRequest.Credentials = creds;

// Parse the Response.
webResponse = (HttpWebResponse)hwRequest.GetResponse();

如果启用了代理服务器设置以使用代理,则调用代理服务器的上述方法。
我在调用时绕过代理服务器解决了这个问题

string sProxyWebAddress = null;
System.Net.WebProxy wbProxy = new System.Net.WebProxy(sProxyWebAddress, true);
hwRequest.Proxy = wbProxy;
wbProxy = null;