使用服务名字对象的经典 ASP 到 WCF

发布于 2024-08-06 00:47:10 字数 1166 浏览 2 评论 0原文

我正在尝试使用经典 ASP 中的 WCF 日志记录服务,而不部署 Com 包装器。我在此处找到了这样做的方法。这是简化的 vb 脚本。

Dim addr
addr = "service:mexAddress=""net.pipe://localhost/Services/Logging/LoggingManager/Mex""," _
& "address=""net.pipe://localhost/Services/Logging/LoggingManager/classic/""," _
& "contract=""ILoggingManagerClassic"", contractNamespace=""http://Services.Logging.Classic/""," _
& "binding=""NetNamedPipeBinding_ILoggingManagerClassic"", bindingNamespace=""http://Services.Logging.Classic/"""

set objErrorLogger = GetObject(addr)
Dim strError : strError = objErrorLogger.LogError("blahblah")

在 Server 2008 上工作,但在 Server 2003 上失败并出现此错误

Failed to do mex retrieval:Metadata contains a reference that cannot be resolved: net.pipe://localhost/Services/Logging/LoggingManager/Mex..

只有通过 ASP 运行时才会失败,同一台计算机上使用相同代码的示例 VBS 文件可以正常工作。

我认为这可能与许可有关,但不知道从哪里开始。有人有什么想法吗?

编辑 - 让我澄清一下,WCF 主机是作为网络服务运行的 Windows 服务。

如果这属于服务器故障,主持人可以移动它。我在那里也有一个帐户。

I am trying to consume a WCF logging service from classic ASP without deploy a Com wrapper. I found a method of doing so here. Here is the vb script, simplified.

Dim addr
addr = "service:mexAddress=""net.pipe://localhost/Services/Logging/LoggingManager/Mex""," _
& "address=""net.pipe://localhost/Services/Logging/LoggingManager/classic/""," _
& "contract=""ILoggingManagerClassic"", contractNamespace=""http://Services.Logging.Classic/""," _
& "binding=""NetNamedPipeBinding_ILoggingManagerClassic"", bindingNamespace=""http://Services.Logging.Classic/"""

set objErrorLogger = GetObject(addr)
Dim strError : strError = objErrorLogger.LogError("blahblah")

This works on Server 2008, but fails with this error on Server 2003.

Failed to do mex retrieval:Metadata contains a reference that cannot be resolved: net.pipe://localhost/Services/Logging/LoggingManager/Mex..

Only when running through ASP does it fail, a sample VBS file on the same machine using the same code works fine.

I think it may be permission related, but don't know where to begin. Anyone have any ideas?

EDIT - let me clarify that the WCF host is a windows service running as NETWORK SERVICE.

If this belongs on server fault, a moderator can move it. I have an account there as well.

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

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

发布评论

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

评论(1

尐籹人 2024-08-13 00:47:10

您正在使用带有网络管道绑定的 WCF。

Windows 2003 不支持网络管道。

更新:

WCF 网络管道使用 Windows 激活服务 (WAS),该服务包含在 Windows 2008

http://msdn.microsoft.com/en-us/magazine/cc163357.aspx

网络管道适用于Windows 2003,但不适用于WCF网络管道

编辑

您的评论是正确的,当您将WCF作为Windows运行时服务而不是在IIS中,它应该在winows 2003上工作。

话虽如此,它肯定与来自ASP网站的调用有关。首先,您的事件日志中是否存在任何错误。

You are using WCF with net pipe binding.

Windows 2003 does not support net pipes.

Update:

WCF net pipe uses windows Activation Serices (WAS) which is included in Windows 2008

http://msdn.microsoft.com/en-us/magazine/cc163357.aspx

Net pipes works on windows 2003, but not WCF net pipes

EDIT

Your comments are right that when you are running the WCF as a windows service and not in IIS, it should work on winows 2003.

Having said that, it must be related to the call coming from the ASP web site. One place to start is, are there any errors in your event log.

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