CSLA .NET

From Rockford Lhotka's Expert C# 2005 and VB 2005 Business Objects books

Welcome to CSLA .NET Sign in | Join | Help
in Search

WCF Error

Last post 05-12-2008, 9:04 AM by RockfordLhotka. 1 replies.
Sort Posts: Previous Next
  •  05-11-2008, 9:04 PM 23489

    WCF Error

    Hi

    We are trying a bit of Silverlight to CSLA via WCF - pre CSLA Lite. As a test we are just assigning from CSLA objects to data objects and transfering the data objects down WCF to Silverlight and back again.

    Getting the data there required increasing the MaxReceivedMessageSize. However getting data back is now the problem. When calling a routine via WCF a parameter size of 8192 goes through, but a parameter of 8193 gets the following error:

    An exception of type 'System.ServiceModel.ProtocolException' occurred in System.ServiceModel.dll but was not handled in user code

    Additional information: [UnexpectedHttpResponseCode]
    Arguments:Not Found
    Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.30226.2&File=System.ServiceModel.dll&Key=UnexpectedHttpResponseCode
    Have tried setting MaxBufferSize also, but no effect, and setting
    <httpRuntime maxRequestLength="32678"/>
    in Weg.Config

    Any ideas?

    Code:

                StringBuilder sb = new StringBuilder() ;
                for (int i = 0; i < 8193 ; i ++)
                    sb.Append('0') ;
                   
                dataXml = sb.ToString() ;   
               
                System.ServiceModel.BasicHttpBinding binding = new System.ServiceModel.BasicHttpBinding() ;
                binding.MaxReceivedMessageSize = int.MaxValue  ;
                binding.MaxBufferSize = int.MaxValue ;
                System.ServiceModel.EndpointAddress remoteAddress = new System.ServiceModel.EndpointAddress("http://localhost:4425/Projection.Central.SilverlightApp_Web/AppDataService.svc") ;
                AppDataService.AppDataServiceClient client = new AppDataService.AppDataServiceClient(
                                                                    binding,
                                                                    remoteAddress) ;
               
                client.UserDataExchangeCompleted +=
                    new EventHandler<AppDataService.UserDataExchangeCompletedEventArgs>(client_UserDataExchangeCompleted);
                client.UserDataExchangeAsync("", dataXml.ToString());

    Thanks
  •  05-12-2008, 9:04 AM 23510 in reply to 23489

    Re: WCF Error

    Just guessing here, but I think you need to set the max sizes on both client and server.
    Rocky
View as RSS news feed in XML

Please contact Magenic for your .NET consulting and CSLA .NET mentoring needs.
Please consider making a donation to help support the ongoing development of CSLA .NET.

Make donation through PayPal - it's fast, free and secure!
Why donate?
Powered by Community Server, by Telligent Systems