簡體   English   中英

WCF服務在調用方法時掛起,但是方法正在工作

[英]WCF service hangs when calling method, however method is working

您好,我的wcf服務出現問題。 我正在嘗試調用返回類型對象列表的方法。 我也在使用實體框架。

public IList<Product> GetAllProducts()
    {
        using (var db = new AuctionContext())
        {
            return db.Products.ToList();
        }
    }

    </service>
  <service name="AuctionSystem.WcfService.ProductService">
    <endpoint address="" binding="wsDualHttpBinding" contract="AuctionSystem.WcfService.Contracts.IProductService">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:9993/Design_Time_Addresses/AuctionSystem.WcfService/ProductService/" />
      </baseAddresses>
    </host>
  </service>

和合同:

 [OperationContract]
    IList<Product> GetAllProducts();

該方法本身正在運行,但是當我嘗試在wcf服務UI上調用此方法時,它卡在“調用服務”上,而我使用的是wsdualhttpbinding。

有什么想法嗎?

編輯:我意識到在Product對象中我有虛擬列表,為什么此列表導致wcf掛起?

所有人都想知道為什么是由於循環依賴引起的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM