2014-03-24 142 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完美作品