2014-03-24 38 views
0

我陷入以下情况 - 我有两个Web应用程序 - AB。他们都在同一台计算机上运行。 B正在托管一个netMsmqBinding WCF服务。另外,B的应用程序池已经自行回收。 A调用B的WCF服务。我看到消息已经到达我创建的私有MSMQ队列。但是,除非我不浏览* .svc URL,否则不会通过B继续进行。 我错过了这项技术所需要的东西吗?什么是实现这种功能的干净方式? 这些是我正在使用的配置。如果我错过了一些有用的信息,请告诉我,我将提供它: 服务(B):IIS中托管的MSMQ WCF

<system.serviceModel> 
    <services> 
     <service name="MyProject.Web.Services.EmsListener"> 
      <endpoint address="net.msmq://localhost/private/myQueue" 
         binding="netMsmqBinding" bindingConfiguration="MyMsmqBinding" 
         contract="MyProject.Abstraction.IEmsListener"> 
      </endpoint> 
      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
     </service> 
    </services> 




<netMsmqBinding > 
       <binding name="MyMsmqBinding" 
         durable="true" 
         receiveRetryCount="2" 
         maxRetryCycles="2" 
         retryCycleDelay="00:01:00" 
         receiveErrorHandling="Move" > 
        <security mode="None"> 
         <message clientCredentialType="None"/> 
         <transport msmqAuthenticationMode="None" msmqProtectionLevel="None" /> 
        </security> 
       </binding> 
      </netMsmqBinding> 

客户端(A):

<system.serviceModel> 
     <bindings> 
<netMsmqBinding> 
       <binding name="MyBinding "> 
        <security mode="None" /> 
       </binding> 
      </netMsmqBinding> 
     </bindings> 
     <client>   
      <endpoint address="net.msmq://localhost/private/myQueue" binding="netMsmqBinding" 
       bindingConfiguration=" MyBinding " contract="EmsListener.IEmsListener" 
       name=" MyBinding " /> 

     </client> 
    </system.serviceModel> 

感谢提前:)

回答

0

这可能是因为IIS在回收后未启动应用程序。

可能的解决方案是配置auto-start。然后,IIS将立即启动您的服务,无需等待第一个请求。

0

Imortist的可能解决方案的作品!

但首先您需要将AppFabric添加到您的ISS,那么您需要确保您的池预设设置中具有“启动模式”选项。

注:在我的Windows 7 IIS7没有工作,但在我的Windows服务器2012 R2 IIS8完美作品