繁体   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