2011-03-19 51 views
1

我有一個使用net:msmq綁定的端點的WCF服務。我在託管的Windows服務中託管此服務。當我嘗試添加從客戶服務的參考,我得到以下錯誤:使用net.msmq時添加WCF服務參考

The MetadataExchangeClient instance could not be initialized 

because no Binding is available for scheme 'net.msmq'. You can supply a Binding in the constructor, or specify a configurationName. Parameter name: scheme If the service is defined in the current solution, try building the solution and adding the service reference again.

的配置是這樣的:

<services> 
    <service behaviorConfiguration="wcfservice.QueuedBehavior" 
    name="wcfservice.wcfservice1"> 
    <endpoint address="net.msmq://machinename/private/queuname" binding="netMsmqBinding" bindingConfiguration="NewBinding0" contract="WCFService.IServiceContract" /> 
    <endpoint binding="mexHttpBinding" contract="IMetadataExchange" /> 
    <host> 
     <baseAddresses> 
     <add baseAddress="http://localhost:8009/Service" /> 
     </baseAddresses> 
    </host> 
    </service> 
</services> 

編輯:

<serviceBehaviors> 
    <behavior name="wcfService.wcfServiceBehavior"> 
     <serviceMetadata httpGetEnabled="True"/> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
    </behavior> 
    <behavior name="wcfService.QueuedBehavior"> 
     <serviceMetadata httpGetEnabled="True"/> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
     <serviceThrottling/> 
    </behavior> 
    </serviceBehaviors> 

感謝

+0

您的服務配置中是否有httpGetEnabled =「True」? – stephenl 2011-03-19 08:15:32

+0

@Steve - 是的。請參閱編輯配置中的元素 – Dusty 2011-03-19 17:27:29

回答

0

這可能是由綁定配置NewBinding0是netMsmqBinding以外的內容引起的。