创建 Web 代理时出错

发布于 2024-07-27 15:47:40 字数 3080 浏览 2 评论 0原文

我有一个启用 CLR 的 .NET 应用程序,它访问 Web 服务并将 xml 文件写入 Web 服务器,以便 SQLServer SSIS 包进行消化。 在开发服务器上一切正常,但生产服务器返回以下错误:

创建指定的 Web 代理时出错 在“system.net/defaultProxy”中 配置部分:位于 System.Net.Configuration.DefaultProxySectionInternal.GetSection() 在 System.Net.WebRequest.get_InternalDefaultWebProxy() 在 System.Net.HttpWebRequest..ctor(Uri uri、ServicePoint 服务点)位于 System.Net.HttpRequestCreator.Create(Uri 乌里)在 System.Net.WebRequest.Create(Uri requestUri,布尔值 useUriBase) at System.Web.Services.Protocols.WebClientProtocol.GetWebRequest(Uri 乌里)在 System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest(Uri 乌里)在 System.Web.Services.Protocols.SoapHttpClientProtocol.GetWebRequest(Uri 乌里)在 System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(字符串 方法名称,对象[]参数)位于 MyDBProj.com.dmsintegration.secure.VehicleInventoryService.RetriveVehicleInventory(RetrieveAllRecordsRequest 请求)在 UserDefinedFunctions.LoadDMSFile(字符串 Dealer_id,字符串 dms_username,字符串 dms_password,字符串dms_location_id)

服务器操作系统版本或 SQLServer 版本之间没有差异。 我们使用的是Windows Server 2003 R2和SQL Server 2005。我相信这一定是服务器本身的配置,但我找不到服务器之间的任何差异。 两台服务器都没有运行软件防火墙。

完全例外:

系统.配置.配置错误异常: 创建指定的 Web 代理时出错 在“system.net/defaultProxy”中 配置部分。 ---> System.DllNotFoundException:无法加载 DLL 'rasapi32.dll':A 动态链接库(DLL) 初始化例程失败。 (HRESULT 异常:0x8007045A)
在 System.Net.UnsafeNclNativeMethods.RasHelper.RasEnumConnections(RASCONN[] lprasconn,UInt32& lpcb、UInt32& lpc连接)在 System.Net.UnsafeNclNativeMethods.RasHelper.GetCurrentConnectoid() 在 System.Net.AutoWebProxyScriptEngine.AutoDetector.Initialize() 在 System.Net.AutoWebProxyScriptEngine..ctor(WebProxy 代理,布尔值 useRegistry) at System.Net.WebProxy.UnsafeUpdateFromRegistry() 在 System.Net.Configuration.DefaultProxySectionInternal..ctor(DefaultProxySection 部分)在 System.Net.Configuration.DefaultProxySectionInternal.GetSection() --- 内部异常堆栈跟踪结束 --- 在 System.Net.Configuration.DefaultProxySectionInternal.GetSection() 在 System.Net.WebRequest.get_InternalDefaultWebProxy() 在 System.Net.HttpWebRequest..ctor(Uri uri、ServicePoint 服务点)位于 System.Net.HttpRequestCreator.Create(Uri 乌里)在 System.Net.WebRequest.Create(Uri requestUri,布尔值 useUriBase) at System.Web.Services.Protocols.WebClientProtocol.GetWebRequest(Uri 乌里)在 System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest(Uri 乌里)在 System.Web.Services.Protocols.SoapHttpClientProtocol.GetWebRequest(Uri 乌里)在 System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(字符串 方法名称,对象[]参数)位于 MyDBProj.com.dmsintegration.secure.VehicleInventoryService.RetriveVehicleInventory(RetrieveAllRecordsRequest 请求)在 UserDefinedFunctions.LoadDMSFile(字符串 Dealer_id,字符串 dms_username,字符串 dms_password,字符串dms_location_id)

I have a CLR enabled .NET app that accesses a webservice and writes an xml file to a webserver for a SQLServer SSIS package to digest. Everything works fine on the development servers, but the production server returns the following error:

Error creating the Web Proxy specified
in the 'system.net/defaultProxy'
configuration section.: at
System.Net.Configuration.DefaultProxySectionInternal.GetSection()
at
System.Net.WebRequest.get_InternalDefaultWebProxy()
at System.Net.HttpWebRequest..ctor(Uri
uri, ServicePoint servicePoint) at
System.Net.HttpRequestCreator.Create(Uri
Uri) at
System.Net.WebRequest.Create(Uri
requestUri, Boolean useUriBase) at
System.Web.Services.Protocols.WebClientProtocol.GetWebRequest(Uri
uri) at
System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest(Uri
uri) at
System.Web.Services.Protocols.SoapHttpClientProtocol.GetWebRequest(Uri
uri) at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters) at
MyDBProj.com.dmsintegration.secure.VehicleInventoryService.RetriveVehicleInventory(RetrieveAllRecordsRequest
request) at
UserDefinedFunctions.LoadDMSFile(String
dealer_id, String dms_username, String
dms_password, String dms_location_id)

There are no differences between the server OS versions or the SQLServer versions. We are using Windows Server 2003 R2 and SQL Server 2005. I believe it must be a configuration on the server itself but I cannot find any differences between the servers. Neither server runs a software firewall.

Full Exception:

System.Configuration.ConfigurationErrorsException:
Error creating the Web Proxy specified
in the 'system.net/defaultProxy'
configuration section.
---> System.DllNotFoundException: Unable to load DLL 'rasapi32.dll': A
dynamic link library (DLL)
initialization routine failed.
(Exception from HRESULT: 0x8007045A)
at
System.Net.UnsafeNclNativeMethods.RasHelper.RasEnumConnections(RASCONN[]
lprasconn, UInt32& lpcb, UInt32&
lpcConnections) at
System.Net.UnsafeNclNativeMethods.RasHelper.GetCurrentConnectoid()
at
System.Net.AutoWebProxyScriptEngine.AutoDetector.Initialize()
at
System.Net.AutoWebProxyScriptEngine..ctor(WebProxy
proxy, Boolean useRegistry) at
System.Net.WebProxy.UnsafeUpdateFromRegistry()
at
System.Net.Configuration.DefaultProxySectionInternal..ctor(DefaultProxySection
section) at
System.Net.Configuration.DefaultProxySectionInternal.GetSection()
--- End of inner exception stack trace --- at System.Net.Configuration.DefaultProxySectionInternal.GetSection()
at
System.Net.WebRequest.get_InternalDefaultWebProxy()
at System.Net.HttpWebRequest..ctor(Uri
uri, ServicePoint servicePoint) at
System.Net.HttpRequestCreator.Create(Uri
Uri) at
System.Net.WebRequest.Create(Uri
requestUri, Boolean useUriBase) at
System.Web.Services.Protocols.WebClientProtocol.GetWebRequest(Uri
uri) at
System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest(Uri
uri) at
System.Web.Services.Protocols.SoapHttpClientProtocol.GetWebRequest(Uri
uri) at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters) at
MyDBProj.com.dmsintegration.secure.VehicleInventoryService.RetriveVehicleInventory(RetrieveAllRecordsRequest
request) at
UserDefinedFunctions.LoadDMSFile(String
dealer_id, String dms_username, String
dms_password, String dms_location_id)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

ゞ记忆︶ㄣ 2024-08-03 15:47:40

当从 .Net Winform 应用程序调用 Web 服务时,我们遇到了完全相同的错误消息。

在我们的例子中,一个用户发生了错误,但同一服务器上的另一个用户(具有本地管理员权限)则没有发生错误。

事实上它与WCF无关; 从应用程序调用简单的网页时,您会遇到相同的错误。 不允许执行用户帐户打开 Web 代理连接。

我们通过将应用程序移至 C:\Program Files 解决了该问题。 由于我还无法准确解释的原因,同一用户可以从该文件夹创建代理。

任何对此的见解都将受到欢迎。

We had exactly the same error message when calling a Web service from a .Net Winform application.

In our case the error occurred for one user, but not for the other (with local admin permissions) on the same server.

In fact it has nothing to with WCF; you would have the same error when calling a simple web page from your app. The executing user account is not allowed to open a Web Proxy connection.

We solved the problem by moving the application into C:\Program Files. For a reason I can't yet explain exactly, from this folder the same user can create the Proxy.

Any insight on this would be welcome.

别靠近我心 2024-08-03 15:47:40

我们也遇到过同样的问题。
创建“system.net/defaultProxy”配置部分中指定的 Web 代理时出错。

我通过更正网站配置文件中的错误条目解决了这个问题。只需确保所有标签都正确打开和关闭。它可能会解决您的问题。

we had faced the same issue.
eror creating the Web Proxy specified in the 'system.net/defaultProxy' configuration section.

I resolved it by correcting the incorrect entries in config files in website.Just make sure that all tags are opned and closed correctly.it may reosolve your issue.

乖乖公主 2024-08-03 15:47:40

詹姆斯,仔细看:

创建“system.net/defaultProxy”配置部分中指定的 Web 代理时出错

James, look closely:

Error creating the Web Proxy specified in the 'system.net/defaultProxy' configuration section

山川志 2024-08-03 15:47:40

当我尝试从 WinDBG 访问源服务器时,发生了此错误。 我在 srcsrv.ini 文件中引用 C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ 文件夹中的 TF.EXE。

我制作了 tf.exe / tf.exe.config 的副本并将其放入 WinDBG 的文件夹中,并且运行良好。

原来,早期从 Microsoft 符号存储下载的符号已将文件夹 winhttp.dll 等放入 C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE文件夹,这些正在被读取。 这使得 tf.exe 无法找到并加载这些 dll。 应该发生的情况是 tf.exe 没有在那里找到它们,而是从 c:\Windows\Syswow64 文件夹中加载它们。

SysInternals 的进程监视器是您的朋友!

This error happened to me when attempting to access Source Server from WinDBG. I was referencing TF.EXE in the C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ folder from my srcsrv.ini file.

I made a copy of tf.exe / tf.exe.config and placed it in the folder with WinDBG, and it worked fine.

It turned out that an earlier download of symbols from the Microsoft Symbol Store had put folders winhttp.dll, etc., in the C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE folder, and those were being read. That made tf.exe unable to find and load those dlls. What should have happened is that tf.exe did not find them there, but instead loaded them from the c:\Windows\Syswow64 folder.

Process Monitor from SysInternals is your friend!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文