net.msmq 无法识别为 WCF 服务

本文关键字:WCF 服务 识别 msmq net | 更新日期: 2023-09-27 18:31:08

尝试

启动承载 WCF 服务的 Windows 服务时出现以下错误:

找不到与绑定 NetMsmqBinding 的终结点的方案 net.msmq 匹配的基址。注册的基址方案是 [http]。

如果我删除 netmsmq 绑定并使用 basichttp 绑定,则工作正常。配置如下:

  <system.serviceModel>
    <services>
      <service name="ManageContactService.ManageContact" behaviorConfiguration="ContactServiceBehavior">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8888/ManageContact/ContactService"/>
          </baseAddresses>
        </host>
        <endpoint address="net.msmq//localhost/private/testqueue" binding="netMsmqBinding" 
                  bindingConfiguration="MyMsmqBinding" contract="ManageContactService.IManageContact" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <bindings>
      <netMsmqBinding>
        <binding name="MyMsmqBinding">
          <security mode="None"></security>
        </binding>
      </netMsmqBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ContactServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="False"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

net.msmq 无法识别为 WCF 服务

你需要一个冒号:

net.msmq://localhost/private/testqueue