配置WCF服务以从Windows服务器服务总线读取消息

时间:2015-01-21 15:49:10

标签: wcf wcf-binding servicebus azureservicebus azure-servicebus-queues

我正在尝试使用以下配置配置WCF SVC。它不从窗口服务器服务总线主题/子目录中获取消息。

当我通过代码动态托管和配置它时,它可以工作。

<bindings>
      <customBinding>
        <binding name="messagingBinding">
          <textMessageEncoding  messageVersion="None"  writeEncoding="utf-8" />
          <netMessagingTransport/>
        </binding>
      </customBinding>

    </bindings>
    <behaviors>
      <endpointBehaviors>
        <behavior name="securityBehavior">
          <transportClientEndpointBehavior>
            <tokenProvider>
              <windowsAuthentication domain="****" password="*****" userName="****">
                <stsUris>
                  <stsUri value="https://{machine/domain}:9355/SampleNamespace" />
                </stsUris>

              </windowsAuthentication>
            </tokenProvider>
          </transportClientEndpointBehavior>


        </behavior>
      </endpointBehaviors>
<services>

      <service name="Myservice.IntegrationService">
        <endpoint name="AccountingEndPoint"
                   listenUri="sb://{machine/domain}:9355/SampleNamespace/accounting/subscriptions/sub"
                   address="sb://{machine/domain}:9355/SampleNamespace/accounting"
                   binding="customBinding"
                   bindingConfiguration="messagingBinding"
                   contract="Myservice.IAccounting"
                   behaviorConfiguration="securityBehavior" />
      </service>
    </services>



[ServiceContract]
    public interface IAccounting
    {
        [OperationContract(IsOneWay = true, Action = "*"), ReceiveContextEnabled(ManualControl = true)]
        void AccountingReader(Message message);
    }

0 个答案:

没有答案