繁体   English   中英

如何在WCF中使用MSMQ绑定从URL调用操作协定

[英]How to call operation contract from URL with MSMQ Binding in wcf

我有一个带有MSMQ绑定的WCF服务,并且工作正常。 那时任何消息进入MSMQ队列。 它正在处理队列,并且消息已从队列中删除。 但是它没有调用操作合同,并且我没有获得有关消息的信息。

有什么方法可以直接调用您的运营合同,还是有其他方法? 我在WAS和MSMQ中托管wcf服务,以下是我的web.config设置。

<system.serviceModel>
  <bindings>
      <netMsmqBinding>
          <binding name="WCFQNonTransactional" exactlyOnce="false">
              <security mode="None"/>
          </binding>
      </netMsmqBinding>
  </bindings>
  <services>
      <service behaviorConfiguration="MyWCFService.MSMQReceiverServiceBehavior" name="MyWCFService.MSMQReceiverService">
          <endpoint address="http://localhost:90/MSMQReceiverService.svc"
                    binding="wsHttpBinding"
                    contract="MyWCFService.IMSMQReceiverService" name="mymsmq">
              <identity>
                  <dns value="localhost" />
              </identity>
          </endpoint>

          <endpoint address="net.msmq://localhost/private/Mywcfservice/msmqreceiverservice.svc"
                    binding="netMsmqBinding" bindingConfiguration="WCFQNonTransactional"
                    contract="MyWCFService.IMSMQReceiverService" />
      </service>
  </services>
  <behaviors>
      <serviceBehaviors>
          <behavior name="MyWCFService.MSMQReceiverServiceBehavior">
              <serviceMetadata httpGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="false"/>
          </behavior>
      </serviceBehaviors>
  </behaviors>

如果未调用操作合同,则意味着将消息从队列中删除时存在问题。 应该为从队列中取出的每个消息调用操作代码。

首先,请确保您正在使用事务性队列,因为如果不是这样,则任何错误都将导致消息丢失。

其次,在客户端和服务器绑定上启用日记功能,您将能够跟踪消息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM