Asp – “maximum string content length quota (8192) has been exceeded while reading XML data” calling WCF via mexAddress moniker

asp.netwcf

I'm attempting to call a WCF service via mex from a classic ASP page. I've got the call working using the details on MSDN, but if I pass back an amount of data exceeding 8K I get an exception stating:

The maximum string content length
quota (8192) has been exceeded while
reading XML data. This quota may be
increased by changing the
MaxStringContentLength property on the
XmlDictionaryReaderQuotas object used
when creating the XML reader…

The fix for this is easy enough in .NET client: you can adjust the client config to having a binding with a readerQuotas section including an increased quota. However, since I'm building a service moniker to pass to a GetObject call within ASP, I don't have access to a config to edit. If it were a VB6 app, I could use dllhost.exe.config, but that's not the case. The bindingConfiguration node (and sub nodes) don't appear to be parameters I can set within the moniker string.

Any ideas on how I could influence this parameter within the ASP context? ASP snippet with moniker string referenced below:

   Dim strXml, moniker, objProxy

   moniker="service:mexAddress='http://localhost/SomeApp/SomeServices/SomeService.svc/mex', "
   moniker=moniker + "address='http://localhost/SomeApp/SomeServices/SomeService.svc',"
   moniker=moniker + "contract=ISomeService, contractNamespace=http://foo.com, "
   moniker=moniker + "binding=WSHttpBinding_ISomeService, bindingNamespace=http://foo.com"

   Set objProxy = GetObject(moniker)

   strXml = objProxy.DoWork("foo", "bar")

Thanks!

Best Answer

Try setting your maxStringContentLength in your wcf binding configuration on the server side.

Related Topic