English 中文(简体)
如何用手法(封闭式)处理这种实地情况
原标题:how can we handle this situvation in wcf [closed]

任何机构都可以帮助我

  1. I am having WCF service its working fine
    wcf having database conectivity database having 100 records
    WCF service fetching records from database these records have to submit to the client system when ever client make a request for records.
  2. when client makes the request for records, it works fine for 10-20 records but fetching records 100 due to huge trafic between client and WCF service, service not providing services.

how can we handle this situvation in WCF?

问题回答

如果放弃信息量太大的例外情况,你可以研究这一问题概述的一些选择:。 为世界合作框架网站()设立马克斯电文和缓冲区。

100份记录表明你将尽最大努力返回? 如果它只是增长和增长,我不会建议改变信息规模。 相反,如果你有这样的方法:

IEnumerable<Record> GetRecords()

成为:

Response GetRecords(index)

接下来的答复就是这样:

[DataContract]
public class Response
{
    [DataMember]
    IEnumerable<Record> Records { get; set; }

    [DataMember}
    bool IsLast { get; set; }

    [DataMember]
    int PageIndex { get; set }
}

然后,你会从客户那里叫它:

Response resp;
int pageIndex = 0;
do
{
    resp = service.GetRecords(pageIndex);
    // use resp.Records here - could just build a bigger list with them all in
    // and use it after the loop or if your client can handle chunks, just use it
    pageIndex = resp.PageIndex + 1;
} while(!resp.IsLast);

这不是最先进的手法,而是给你带来希望的开端。





相关问题
WCF DataMember Serializing questions

Ok, so I was part way through the long winded process of creating DTOs for sending my model over the wire and I don t feel like I m going down the right route. My issue is that most of the entities ...

Access WCF service on same server

I have a .NET website with a WCF service. How do I access the current operations context of my service? One possible work around is to just make a call to the service within the app...but that seems ...

WCF binding error

So I got into work early today and got the latest from source control. When I try to launch our ASP.NET application, I get this exception: "The binding at system.serviceModel/bindings/wsHttpBinding ...

The service operation requires a transaction to be flowed

I am facing strange issue with our WCF service. The same code was working fine until recently we added more OperationContracts(Web Methods). We have common 3 tier architecture. DAL (WCF) BLL Web ...

热门标签