WCF service The maximum array length quota (16384) has been exceeded

Actually, I’ve solved the problem by adding readerQuotas within textMessageEncoding section. Thanks for the help. <textMessageEncoding messageVersion=”Soap11″> <readerQuotas maxDepth=”32″ maxStringContentLength=”5242880″ maxArrayLength=”2147483646″ maxBytesPerRead=”4096″ maxNameTableCharCount=”5242880″/> </textMessageEncoding>

Hosting WCF service inside a Windows Forms application

This code should be enough to get you started: Form1.cs namespace TestWinform { public partial class Form1 : Form { private ServiceHost Host; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { Host = new ServiceHost(typeof(MyWcfService)); Host.Open(); } private void Form1_FormClosed(object sender, FormClosedEventArgs e) { Host.Close(); } } } App.config <?xml version=”1.0″ … Read more

Adding basic HTTP auth to a WCF REST service

I was also interested in custom authentication in a REST HTTP WCF service and finally got it to work. That being said my code will give you a way to get it working, but I recommend reading this guide which explains everything in more depth: http://wcfsecurityguide.codeplex.com/ First, change the system.web portion of your Web.Config to … Read more

Expose a WCF Service through a Named Pipes binding

Your endpoint looks fine, although I’m curious about what’s in localBinding… Sounds like the easiest option is to just change the endpoint configuration on the named pipes client to match your service endpoint. The client shouldn’t care as long as it’s the only endpoint in the clients config file. Otherwise you’ll have to add names … Read more

WCF NetTcpBinding with mex

You need to use the <serviceMetadata> element. <behaviors> <serviceBehaviors> <behavior name=”metadataSupport”> <!– Enables the IMetadataExchange endpoint in services that –> <!– use “metadataSupport” in their behaviorConfiguration attribute. –> <!– In addition, the httpGetEnabled and httpGetUrl attributes publish –> <!– Service metadata for retrieval by HTTP/GET at the address –> <!– “http://localhost:8080/SampleService?wsdl” –> <serviceMetadata httpGetEnabled=”true” httpGetUrl=””/> … Read more

WCF Web Service Custom Exception Error to Client

In WCF, you should not throw standard .NET exceptions – this is contrary to the potentially interoperable nature of WCF – after all, your client could be a Java or PHP client which has no concept of .NET exceptions. Instead, you need to throw FaultExceptions (which is the standard behavior for WCF). If you want … Read more