tags:

views:

1517

answers:

2

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!

+1  A: 

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

Shiraz Bhaiji
A: 

It's my understanding that the service:mexAddress moniker actually uses a WCF client behind the COM interface. If that is the case then you can store the WCF config in a file called «foo».exe.config, where «foo» is replaced by the name of the executable.

If you are running the ASP within IIS6 or IIS7, then the EXE that runs the ASP is probably w3wp.exe, which means you need to drop the config into a file called w3wp.exe.config , located in the directory c:\Windows\system32\inetsrv.

Cheeso
This is a good suggestion, unfortunately I haven't been able to get it to work. My environment has to support IIS 5.1, so I tried the same approach with an inetinfo.exe.config but still no dice. Even tried dropping in my binding info into the machine.config with no luck.
Thermite