net.msmq无法识别WCF服务

时间:2013-09-12 14:56:10

标签: c# wcf msmq

尝试启动托管WCF服务的Windows服务时出现以下错误:

  

无法找到与绑定NetMsmqBinding的端点匹配scheme 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>

1 个答案:

答案 0 :(得分:2)

你需要一个冒号:

net.msmq://本地主机/私人/ testqueue