我正在嘗試製作一個監聽Service Bus的WCF應用程序。如何在設置multipleSiteBindingsEnabled爲true時設置WCF應用程序
<service behaviorConfiguration="MyServiceTypeBehavior"
name="WcfService3.Service1">
<endpoint address="https://namespace.servicebus.windows.net/WebHttpService"
behaviorConfiguration="sharedSecretClientCredentials"
binding="webHttpRelayBinding"
bindingConfiguration="WebHttpRelayEndpointConfig"
name="RelayEndpoint"
contract="WcfService3.IService1"/>
</service>
當multipleSiteBindingsEnabled
設置爲true
,我改變了配置爲以下:
<service behaviorConfiguration="MyServiceTypeBehavior"
name="WcfService3.Service1">
<host>
<baseAddresses>
<add baseAddress="https://namespace.servicebus.windows.net/" />
</baseAddresses>
</host>
<endpoint address="WebHttpService"
behaviorConfiguration="sharedSecretClientCredentials"
binding="webHttpRelayBinding"
bindingConfiguration="WebHttpRelayEndpointConfig"
name="RelayEndpoint"
contract="WcfService3.IService1"/>
</service>
這個結果時multipleSiteBindingsEnabled
設置爲false
在Web.config中定義的服務下面的代碼片段工作在以下錯誤中: Could not find a base address that matches scheme https for the endpoint with binding WebHttpRelayBinding. Registered base address schemes are [http].
還有什麼我需要聲明的服務,以便它註冊https作爲sch EME?請注意,我確實具有綁定的安全模式作爲傳輸。
我正在嘗試爲mex添加另一個端點(從上面的配置中刪除它)。有沒有辦法揭露這一點? – TheDude
你應該能夠,這段代碼有一個如何通過SB公開MEX端點的例子:http://msdn.microsoft.com/en-us/wazplatformtrainingcourse_servicebusadvancedconfigurations.aspx –