WCF、MSMQ - 协议“net.msmq”;不支持
当我尝试在 Visual Studio 中向 WCF 服务添加服务引用时,出现错误“不支持协议‘net.msmq’”。
我已成功运行 appcmd set site "Default Web Site" -+绑定。[协议='net.msmq',bindingInformation='localhost']
我可以在 applicationHost.config 文件中看到配置。由于我在 Visual Studio 中运行服务,是否需要为特定应用程序启用 net.msmq 协议(appcmd set app "Default Web Site/MsmqService" /enabledProtocols:net.msmq)?由于我的服务在 Visual Studio 中运行,我不确定如何执行此操作?如果我不需要这样做,还有什么问题。这是我的配置。任何帮助表示赞赏..
<configuration>
<system.serviceModel>
<services>
<service name="MessageRoutingService"
behaviorConfiguration="ServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:29376" />
</baseAddresses>
</host>
<endpoint name="Response"
address="net.msmq://localhost/private/Response"
binding="netMsmqBinding"
bindingConfiguration="TransactedBinding"
contract="IResponse" />
<endpoint
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<bindings>
<netMsmqBinding>
<binding name="TransactedBinding">
<security mode="None">
</security>
</binding>
</netMsmqBinding>
</bindings>
</system.serviceModel>
</configuration>
I am getting the error "the protocol 'net.msmq' is not supported" when I try and add a service reference to my WCF service in visual studio.
I have successfully ran appcmd set site "Default Web Site" -+bindings.[protocol='net.msmq',bindingInformation='localhost']
and I can see the configuration in the applicationHost.config file. Since I am running my service in visual studio, do I need to enable the net.msmq protocol for my specific application (appcmd set app "Default Web Site/MsmqService" /enabledProtocols:net.msmq)? Im not sure how to do this since my service is running in visual studio? If i dont need to do this, what else could be the issue. Here is my config. Any help appreciated..
<configuration>
<system.serviceModel>
<services>
<service name="MessageRoutingService"
behaviorConfiguration="ServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:29376" />
</baseAddresses>
</host>
<endpoint name="Response"
address="net.msmq://localhost/private/Response"
binding="netMsmqBinding"
bindingConfiguration="TransactedBinding"
contract="IResponse" />
<endpoint
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<bindings>
<netMsmqBinding>
<binding name="TransactedBinding">
<security mode="None">
</security>
</binding>
</netMsmqBinding>
</bindings>
</system.serviceModel>
</configuration>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要启用组件“Microsoft Message Queue (MSMQ) Server”(1) 并在 IIS 上的应用程序中添加“net.MSMQ”协议(2)。
转到“程序和功能”中的“打开或关闭 Windows 功能”,选中“Microsoft 消息队列 (MSMQ) 服务器”下的组件。
转到 IIS 上的应用程序,单击“高级设置”,然后“启用协议”添加此“,net.MSMQ”。
You need to enable the component "Microsoft Message Queue (MSMQ) Server" (1) and add "net.MSMQ" protocol in your application on IIS (2).
Go to "Program and Features" in "Turn Windows features on or off" checked components under "Microsoft Message Queue (MSMQ) Server".
Go to application on IIS, click "Advanced Settings" then "Enabled Protocols" add this ",net.MSMQ".