Note that there are some explanatory texts on larger screens.

plurals
  1. POBatch query to webservice returns "The Uri string is too long"
    primarykey
    data
    text
    <p>I'm trying to send big request to server and get big data. So i use batch request to Data Service. URI of this request looks like this "hxxp://company/Test.svc/$batch". I'm using .Net 4.0</p> <p>I send valid POST request: </p> <pre><code>DataServiceRequest[] Request = new DataServiceRequest[]{new DataServiceRequest&lt;TTable&gt;((query).RequestUri)}; try { DataServiceResponse dsr = WebService.ExecuteBatch(Request); foreach (QueryOperationResponse qr in dsr) { if (qr.Query.ElementType == typeof(TTable)) { foreach (TTable item in qr) { list.Add(item); } } } } </code></pre> <p>And recieve an error message:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" standalone="yes"?&gt; &lt;error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"&gt; &lt;code&gt;&lt;/code&gt; &lt;message xml:lang="ru-RU"&gt;An error occurred while processing this request.&lt;/message&gt; &lt;innererror&gt; &lt;message&gt;Invalid URI: The Uri string is too long.&lt;/message&gt; &lt;type&gt;System.UriFormatException&lt;/type&gt; &lt;stacktrace&gt; at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)&amp;#xD; at System.Uri..ctor(String uriString, UriKind uriKind)&amp;#xD; at System.Data.Services.RequestUriProcessor.GetAbsoluteUriFromReference(String reference, Uri absoluteServiceUri)&amp;#xD; at System.Data.Services.BatchServiceHost..ctor(Uri absoluteServiceUri, BatchStream batchStream, String contentId, String boundary, StreamWriter writer)&amp;#xD; at System.Data.Services.DataService`1.BatchDataService.CreateOperationContextFromBatchStream(Uri absoluteServiceUri, BatchStream batchStream, HashSet`1 contentIds, String boundary, StreamWriter writer)&amp;#xD; at System.Data.Services.DataService`1.BatchDataService.HandleBatchContent(Stream responseStream)&lt;/stacktrace&gt; &lt;/innererror&gt; &lt;/error&gt; </code></pre> <p>It seems like server side exception, occures when it try to parse big uri. How to avoid this limitation?</p> <p><strong>MODIFIED (28/01/2013 at 16:00)</strong></p> <p>IIS configuration:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;configuration&gt; &lt;system.webServer&gt; &lt;security&gt; &lt;requestFiltering&gt; &lt;requestLimits maxAllowedContentLength="500000000" maxQueryString="209715000" maxUrl="2000000"&gt;&lt;/requestLimits&gt; &lt;/requestFiltering&gt; &lt;/security&gt; &lt;directoryBrowse enabled="true"/&gt; &lt;httpErrors errorMode="Detailed"/&gt; &lt;caching enabled="false" enableKernelCache="false"/&gt; &lt;/system.webServer&gt; &lt;system.web&gt; &lt;httpRuntime executionTimeout="4800" maxQueryStringLength="2097150" maxUrlLength="2097150" relaxedUrlToFileSystemMapping="true" maxRequestLength="500000000" requestValidationMode="4.0"/&gt; &lt;customErrors mode="Off"/&gt; &lt;compilation debug="true" targetFramework="4.0"&gt; &lt;assemblies&gt; &lt;add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /&gt; &lt;add assembly="System.Data.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /&gt; &lt;add assembly="System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /&gt; &lt;/assemblies&gt; &lt;/compilation&gt; &lt;/system.web&gt; &lt;/configuration&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload