如何在 Windows Vista 上使用 netNamedPipeBinding 和 WAS 在 Web 应用程序中托管 WCF 服务

发布于 2024-08-02 10:06:24 字数 2880 浏览 3 评论 0原文

我正在尝试在 Vista 计算机上的 Web 应用程序中使用 netNamedPipeBinding 托管 WCF 服务。

我按照本文所述启用了非 HTTP 服务激活: http:// msdn.microsoft.com/en-us/library/ms731053.aspx

我按如下方式配置服务:

<endpoint address="net.pipe://myservice"
binding="netNamedPipeBinding"
bindingConfiguration="MyService_NamedPipeBindingConfig"
contract="ICMyService" />

<netNamedPipeBinding>
    <binding name="MyService_NamedPipeBindingConfig"
         maxBufferSize="2147483647"
         maxReceivedMessageSize="2147483647">
        <security mode="None">
            <transport protectionLevel="None" />
        </security>
    </binding>
</netNamedPipeBinding>

当我浏览到 .svc 文件(在 IIS 上,而不是 Visual Studio Web 服务器上)时,我收到以下消息:

[InvalidOperationException: The protocol 'net.pipe' is not supported.]
   System.ServiceModel.Activation.HostedTransportConfigurationManager.InternalGetConfiguration(String scheme) +11461251
   System.ServiceModel.Channels.TransportChannelListener.OnOpening() +84
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +229
   System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +72

[InvalidOperationException: The ChannelDispatcher at 'net.pipe://myservice' with contract(s) '"IMyService"' is unable to open its IChannelListener.]
   System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +118
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +261
   System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +107
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +261
   System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +121
   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479

[ServiceActivationException: The service '/myservicehost/myservice.svc' cannot be activated due to an exception during compilation.  The exception message is: The ChannelDispatcher at 'net.pipe://myservice' with contract(s) '"IMyService"' is unable to open its IChannelListener..]
   System.ServiceModel.AsyncResult.End(IAsyncResult result) +11536522
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176
   System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +278
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

I希望使用 WAS 进行更快、更轻松的部署,但这个例外并没有帮助。有谁知道我是否做错了什么?

I am trying to host a WCF service with netNamedPipeBinding in a web applicaion on a Vista machine.

I enabled the non-HTTP service activation as described in this article: http://msdn.microsoft.com/en-us/library/ms731053.aspx

I configured the service as follows:

<endpoint address="net.pipe://myservice"
binding="netNamedPipeBinding"
bindingConfiguration="MyService_NamedPipeBindingConfig"
contract="ICMyService" />

<netNamedPipeBinding>
    <binding name="MyService_NamedPipeBindingConfig"
         maxBufferSize="2147483647"
         maxReceivedMessageSize="2147483647">
        <security mode="None">
            <transport protectionLevel="None" />
        </security>
    </binding>
</netNamedPipeBinding>

When I browse to the .svc file (on IIS, not the Visual studio webserver) I get this message:

[InvalidOperationException: The protocol 'net.pipe' is not supported.]
   System.ServiceModel.Activation.HostedTransportConfigurationManager.InternalGetConfiguration(String scheme) +11461251
   System.ServiceModel.Channels.TransportChannelListener.OnOpening() +84
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +229
   System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +72

[InvalidOperationException: The ChannelDispatcher at 'net.pipe://myservice' with contract(s) '"IMyService"' is unable to open its IChannelListener.]
   System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +118
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +261
   System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +107
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +261
   System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +121
   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479

[ServiceActivationException: The service '/myservicehost/myservice.svc' cannot be activated due to an exception during compilation.  The exception message is: The ChannelDispatcher at 'net.pipe://myservice' with contract(s) '"IMyService"' is unable to open its IChannelListener..]
   System.ServiceModel.AsyncResult.End(IAsyncResult result) +11536522
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176
   System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +278
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

I was hoping for a quicker and easier deployment using WAS, but this exception is not helping. Does any body know if I am doing somehting wrong?

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

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

发布评论

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

评论(1

佼人 2024-08-09 10:06:24

您是否完全按照该文章进行操作,或者是否将命令行中的“net.tcp”实例替换为“net.pipe”?可能只是您没有为该网站和虚拟目录启用 net.pipe 绑定。

Did you follow that article exactly, or did you replace instances of 'net.tcp' in the command lines with 'net.pipe'? It may just be that you did not enable the net.pipe binding for that web site and your virtual directory.

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