English 中文(简体)
我如何从银星申请中从方案上确定最大程度的InObject Graph财产?
原标题:How can I set the maxItemsInObjectGraph property programmatically from a Silverlight Application?

我有一份银星3.0号申请,该申请正在利用WCF服务机构与数据库进行交流,如果我有大量数据从服务方法中收回,我就会发现“服务公司”错误。 我完全相信,解决办法只是更新最高不动产,但我正在gro然地创建服务客户,无法找到确定这种财产的地点。 这里,我现在做的是:

BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.None)
{
    MaxReceivedMessageSize = int.MaxValue,                  
    MaxBufferSize = int.MaxValue
};                        

MyService.MyServiceServiceClient client = new MyService.MyServiceProxyServiceClient(binding, new EndpointAddress(new Uri(Application.Current.Host.Source, "../MyService.svc")));
最佳回答

它的定义不具有约束力,而是服务决定因素。

银团 图表中遗漏了MaxValue。

http://web.archive.org • 客户中MaxItemsInObject Graph财产的方案设计

《刑法》序言:

protected ISecurityAdministrationService GetSecAdminClient()
{
     ChannelFactory<ISecurityAdministrationService> factory = new    ChannelFactory<ISecurityAdministrationService>(wsSecAdminBinding, SecAdminEndpointAddress);
     foreach (OperationDescription op in factory.Endpoint.Contract.Operations)
     {
       DataContractSerializerOperationBehavior dataContractBehavior =op.Behaviors.Find<DataContractSerializerOperationBehavior>() as DataContractSerializerOperationBehavior;
       if (dataContractBehavior != null)
       {
             dataContractBehavior.MaxItemsInObjectGraph = 2147483647;
       }
     }
    ISecurityAdministrationService client = factory.CreateChannel();
    return client;
}
问题回答

下面是我从继承的客户物体内使用的一种功能。

System.ServiceModel.ClientBase(Of IServiceName)

这种方法的目的是按方案确定每个业务的MaxItemsInObject Graph值。 这使我的结构更加复杂。

    Private Sub IncreaseObjectCount()
        For Each op As System.ServiceModel.Description.OperationDescription In Me.Endpoint.Contract.Operations
            For Each dscob As System.ServiceModel.Description.DataContractSerializerOperationBehavior In op.Behaviors.FindAll(Of System.ServiceModel.Description.DataContractSerializerOperationBehavior)()
                dcsob.MaxItemsInObjectGraph = Integer.MaxValue
            Next dcsob
        Next op
    End Sub

我通常在物体的构造中叫它。

改变目标 每一端点的WCF服务图,在银灯中加以改变,意味着客户能够支持行为,但服务机构必须支持这种行为。

在你任职后,重新启用代理/更新的网络服务,并将获得新的服务参考。 简言之,这将包括新的最高值





相关问题
Test "User Must Change Password" field in .Net 3.5

I m trying to perform some basic AD User managment tasks in C# using .Net 3.5 I ve got a System.DirectoryServices.AccountManagement.UserPrincipal object that contains the user details. I can call ...

Entity Framework - Many to many question

I have a table called ASB and a table called PeopleInvolved. There is a junction table called PeopleInvolved_ASB which simply contains an ASBID and a PeopleInvolvedID column. The columns act as a ...

WCF: DuplexChannelFactory timeout error

I m using a DuplexChannelFactory when accessing my WCF service so that my service can use a callBackChannel to communicate back to the client. That s all fine but I get a timeout error when creating ...

AutoResetEvent, ManualResetEvent vs Monitor

Lets say I have to orchestrate a synchronization algorithm in .Net 3.5 SP1 and any of the synchronization primitives listed in the title fit perfectly for the task. From a performance perspective, is ...

Managing multiple .Net-Frameworks on a webserver

So I m in charge to deploy my project on the productive server where some other ASP.NET-Websites are also set up. The problem now is that I wrote my whole project under .NET 3.5 but on the webserver ...

Unit Testing .NET 3.5 projects using MStest in VS2010

There s a bug/feature in Visual Studio 2010 where you can t create a unit test project with the 2.0 CLR. https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=483891&wa=...

热门标签