.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

WCF Service Bad request with large data

Posted By:      Posted Date: October 28, 2010    Points: 0   Category :WCF
What are Maximum Limit for maxReceivedMessageSize attribute in config file. What are the consequences if we set that and other attribute like maxBufferSize, maxBufferPoolSize, maxReceivedMessageSize to maximum value. Are there any performance drawback.


View Complete Post

More Related Resource Links

WCF Service fails with Unexpected connection closed with large amount of data

Good day all,   I'm sure this question is relatively simple, but I'm quite new to WCF (been on a Java project the last few years and it's nice to be back in MS territory even if a lot has changed!).   Anyway, here's all the details of my scenario I was hoping someone could shed some light on.   1)  This WCF service is hosted as a webservice and is being testing in the WCF Test Tool. 2)  There is a method call on the service that, while rarely used, can return a fair amount of data (over 20,000 objects) - this is a requirement of the system 3)  The object that is being serialized has the following signature/contract (property changed for example): [DataContract] public class Foo { private string prop1; [DataMember] public string Prop1 { get { return prop1; } set { prop1= value; } } private string prop2; [DataMember] public string Prop2 { get { return prop2; } set { prop2= value; } } private string prop3; [DataMember] public string Prop3 { get { return prop3; } set { prop3= value; } } private string Prop4; [DataMember] public string FaaCode { get { return prop4; } set { prop4= value; } } private string prop5; [DataMember] public string Prop5 { get { return prop5; } set { prop5= value

400 Bad Request when trying to send large file to service using basichttp streaming.


Hi All,


I am trying to send the large file (approx 1.5GB) to the WCF service for upload using basic http streaming.

I have increased all the timeouts and quotas in the server and client's config files to quite large values, but still I am getting Bad Request error on the client.


Also the Bad request message is returned always in 1 minute 30 seconds after sending the request to server.


What the most unusual thing is when I use Fiddler or Charles to debug communication, everything works fine. Is it something like fiddler is pinging the IIS or service and hence its not getting timeouted or like that?




Following are the details:

Server Config:


 <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />

Uploading Large files via Web Service | HTTP Error 413 - Request Entity Too Large.


Hello all -

I am trying to implement a Web Service, which accepts a binary file as a byte array for one of its parameters.  It's workings are based on this article:

Anyhow, the size of the file can be significant as the types of files being uploaded through the service are MP4 Video files.  The service works on my WinXP SP2 localhost, but when I implement it onto a 2003 Server and try to consume the service, I get the following error back from the web service:
The request failed with HTTP status 413: Request Entity Too Large.

I do a little searching around and find a few articles indicating that I need to adjust my "MaxReadAheadLength" property in IIS.  A good example of one of those articles is here:

The suggestion from the article is to execute the following command on the web server:
cscript adsutil.vbs set w3svc/1/uploadreadaheadsize 204800 

FYI, the adsutil.vbs is in your IIS's AdminScripts directory.  I'm guessing that the /1/ part of the command is th



Dear gentlemen and ladies of the Microsoft Dynamic Data Team,

Mr. Steve Naughton says (and I hope so) that there might be chances that you read the posts published in this forum: I really hope so.

If that were the case then I am formally requesting to you in providing a "real answer" to my question:

I want to customize a dynamic data page (the details one) so I can have access to the data it has been already gathered from the end user UI (details.aspx) and use it to pass this same data to the following controls/pages that I am going to display next time to the end user.

For instance:

I have a screen with different types of data in it: texts, numbers, dates, check boxes, radio buttons and dropdownlists that has been filled with data by the end user. I want now to reset all fields exept the dropdownlist of which I'd like to keep the previously chosen values(the very same thing you do between dropdownlist of List.aspx ad Details.aspx). Even with FoxPro I could do that because data and controls were available there. It was as simple as setting carrying on to true.


I have found my

WCF Data Service to JSON example? v4


I would like to take WCF Data Service and produce JSON output to consume on various mobile apps.

Can anyone give me a how-to on the JSON part?  I.e., what is different than normal XML outut?



Data Points: Service-Driven Apps With Silverlight 2 And WCF


Here John Papa demonstrates how to build a Silverlight 2 user interface that communicates through WCF to interact with business entities and a database.

John Papa

MSDN Magazine September 2008

Data Points: Using XQuery, New Large DataTypes, and More


SQL Server 2005 introduces a lot of new features, but it also enhances the popular and oft-used Transact-SQL (T-SQL) language. Changes include the introduction of new datatypes to store large values using the MAX indicator, the integration of enhanced XML querying and data modification with XQuery, and the new XML datatype.

John Papa

MSDN Magazine March 2006

Multiprocessor Optimizations: Fine-Tuning Concurrent Access to Large Data Collections


Application performance involves more than just speed. In a Web server environment, top performance also means ensuring that the maximum numbers of users can be served concurrently. This can be accomplished through efficient use of multiprocessor machines and thread management. This article presents techniques that can solve a number of concurrency problems. One approach, using thread management, controls access to a database on a per-thread basis, which protects the integrity of the data. In the article, reusable thread classes are built and presented. The classes are then tested and their performance in a live environment is examined.

Ian Emmons

MSDN Magazine August 2001

Web Service that will receive xml request and send xml response


I am trying to create a web service that can do the following functionality:

Request XML 

<?xml version="1.0" encoding="UTF-8"?>
<Authentication UserName="test" Password="test" MyId="0987">

Response XML - After authenticating request xml from client send them back the following response:

<?xml version="1.0" encoding="UTF-8"?>
   <Test MyId="0987">
       <TestType id="11"></TestType>
       <TestType id="22"></TestType>

How can I create web service to do this.

WCF issues sending large data - "An existing connection was forcibly closed by the remote host"

Hi Guys I have posted the following on www.asp.net but thought it might be productive posting here too.I have been pulling my hair out trying to fix an issue with sending data over WCF, I have read pretty much every THREAD on this forum regarding or similar to this issue without any successful solution.  I have a simple data object which has a [DataMember] with a data type of byte[]. I use this to send binary data from my web app as follows: Asp.net MVC website --> WCF Client (Has my Service References) --> My Services (MyServices.svc) --> Business/Data Tier Everything is being executed from within VS 2008 Pro.   Now I have successfully sent data up to 2.2MB, however it fails if i try and send a file such as 2.3MB or larger i get the following exceptions: General Exception Exception rethrown at [0]:    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)   at SoftApp.WCFClient.MyServiceReference.IMyService.Document_Save(DtoDocument dtoDocument, Int32 usercode)   at SoftApp.WCFClient.MyServiceReference.MyServiceClient.Document_Save(DtoDocument dtoDocument, Int32 usercode) in c:\dev\softapp\softapp.wcfclient\service references\myservicereference\refe

SQL 2008 R2 (final): SSMS freezes: "Failed to retrieve data for this request.

The original thread is locked for some reason--but the cause of the bug had something to do with the "ssms tools pack" add-in, which, according to the comments in the connect item, will be fixed in an update of ssms tools: http://social.msdn.microsoft.com/Forums/en-US/sqlkjdatabaseengine/thread/f65737b7-fe4d-487b-aa41-ef437d100bc7 https://connect.microsoft.com/SQLServer/feedback/details/556169/ssms-completely-locked-up-after-right-clicking-a-table  

System.Security.SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlCli

I have created a windows library control that accesses a local sql database I tried the following strings for connecting Dim connectionString As String = "Data Source=localhost\SQLEXPRESS;Initial Catalog=TimeSheet;Trusted_Connection = true" Dim connectionString As String = "Data Source=localhost\SQLEXPRESS;Initial Catalog=TimeSheet;Integrated Security=SSPI"   I am not running the webpage in a virtual directory but in C:\Inetpub\wwwroot\usercontrol and I have a simple index.html that tries to read from an sql db but throws the error System.Security.SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.   at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)   at System.Security.PermissionSet.Demand()   at System.Data.Common.DbConnectionOptions.DemandPermission()   at System.Data.SqlClient.SqlConnection.PermissionDemand()   at System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection)   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, etc etc  The action that failed was:DemandThe type of the first permission that failed was:System.Data.SqlClient.SqlClientPermissionThe Zone of the assembly that fa

MERGE using jQuery with a WCF Data Service

I'm a bit new to the whole asp.net thing so this is probably a silly question, but here it goes: I have created a WCF Data service based based on a ADO.net Entity--it's very basic: namespace raid{ public class allPeopleDataService : DataService< raid.raidEntities > { public static void InitializeService(DataServiceConfiguration config) { config.SetEntitySetAccessRule("*", EntitySetRights.All); config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2; } }} I've been successfully retrieving data using jquery's '$.getJSON' and inserting data using a modified $.ajax: $.ajax({url: "/allPeopleDataService.svc/lists",dataType: 'json',contentType: 'application/json',data: $jsonObj,processData: false,type: 'POST'}); I was reading the post at http://msdn.microsoft.com/en-us/library/cc668771.aspx and trying to use the MERGE method to update parts of the data with the following jquery jsont = { "__metadata": { "uri": "/allPeopleDataService.svc/lists(1)", "type":"raidModel.list" }, "list_name": "list blah blah" }; $.ajax({ url: "/allPeopleDataService.svc/lists(1)", dataType: 'json',

All data in class properties disappear across WCF service

Hi, I have a class that i share betwee silverlight client and wcf service. I populate properties of the class with real data from the client, to be used in the server. I use debugger to step through the code when the call gets to the server, all the data ara gone and are replaced with null. All DateTime value change to 1/1/1001. But if pass primitive types such as int, string, no problem. This is happening only on one machine, but not on ther machine. Can someone tell me what is going on here? Thanks in advance

Server ERROR: An error occurred during the parsing of a resource required to service this request.

I have created one asp.net 2.0 application and created a setup project. I run this setup in my local machine, the application run fine, but i uploaded into online server I met the following parser error.How to solve this error? Kindly help me. Very urgent.. Kamal....

While calling Web service gets exception "The request failed with HTTP status 401: Unauthorized"

Hi All, I created a ASP.NET web service, which was hosted on default visual studioserver, and on excecution of webservice it run .exe file which in turn update xml file. Now i hosted this webservice on IIS 6.0 server, and when i run the service, itfails to execute the exe.When i run it on debug mode, i never get any exception.Code...public string HelloWorld()    {        Process myProcess = new Process();        try        {            myProcess.StartInfo.UseShellExecute = false;            // You can start any process,             myProcess.StartInfo.FileName = @"E:\Projects\some.exe";            myProcess.StartInfo.CreateNoWindow = true;            myProcess.Start();            myProcess.Close();            myProcess.Dispose();            return "Suceess";         }&n

Customizing pages with Asp.Net Dynamic Data Domain Service Web Applications?

Hola, It used to be so easy creating new folder under CustomPages with the (Entity/Table name) and copying on it all base default PageTemplates (Details, Insert, Edit, List and ListDetails) and you will get access to those pages only for the specific table (this was the default automatic behavior of the Dynamic Data framework) When it comes to be using Asp.Net Dynamic Data Domain Service Web Applications it seems that we need to learn a new way of doing this because it is just simply different and you got a lot of errors when compiling your application if you do this the old way? What might be the new way, uh? HOW DO WE DO THIS NOW ... I MEAN ... CREATING DEFAULT CUSTOM PAGES FOR SPECIFIC TABLES (Details, Insert, Edit, List and ListDetails) with Asp.Net Dynamic Data Domain Service Web Applications? The problem arises when the definition for your newly created classes is absent from the automatically generated code when you created your domain service !!!!! . If you simply copy the PageTemplates as they are, you got a duplicated error message because the new .designer file (automatically generated) conains the definition of the class you are copying (not the newer one) so even if you rename your .aspx file the result is not what you would normally expect (the .designer class is not regenerated after renaming). The .designer file keeps the domain service definition and if y
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend