Note that there are some explanatory texts on larger screens.

plurals
  1. POWindows Azure maxReceivedMessageSize set
    text
    copied!<p>I have a problem with large amount of data that I want to send to my WCF WebRole. I get (413) too large data error. I quite new in Azure and WCF. I created a new service for sending images to WCF (LargeObject.svc) and tried to configure binding and endpoint for it.</p> <p>This is the ServerSideCode:</p> <pre><code> &lt;system.serviceModel&gt; &lt;bindings&gt; &lt;basicHttpBinding&gt; &lt;binding name="BasicHttpBinding_IImage" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647"&gt; &lt;readerQuotas maxDepth="32" maxArrayLength="200000000" maxStringContentLength="200000000"/&gt; &lt;/binding&gt; &lt;binding name="BasicHttpBinding_IRouteService"/&gt; &lt;/basicHttpBinding&gt; &lt;customBinding&gt; &lt;binding name="CustomBinding_IRouteService"&gt; &lt;binaryMessageEncoding /&gt; &lt;httpTransport /&gt; &lt;/binding&gt; &lt;/customBinding&gt; &lt;/bindings&gt; &lt;client&gt; &lt;endpoint address="http://dev.virtualearth.net/webservices/v1/routeservice/routeservice.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IRouteService" contract="Route.IRouteService" name="BasicHttpBinding_IRouteService" /&gt; &lt;endpoint address="http://dev.virtualearth.net/webservices/v1/routeservice/routeservice.svc/binaryHttp" binding="customBinding" bindingConfiguration="CustomBinding_IRouteService" contract="Route.IRouteService" name="CustomBinding_IRouteService" /&gt; &lt;endpoint address="http://127.0.0.1:81/Implementation/LargeObject.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IImage" contract="ILargeObject" name="BasicHttpBinding_IImageSvc"/&gt; &lt;/client&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior&gt; &lt;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&gt; &lt;serviceMetadata httpGetEnabled="true"/&gt; &lt;!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --&gt; &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt; &lt;dataContractSerializer maxItemsInObjectGraph="1048576" /&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt; </code></pre> <p></p> <p>I have also a client Application in Windows Phone, code:</p> <pre><code>string endPointAddress = (Application.Current as TravelerMobile.App).ServerUriString("LargeObject.svc"); LargeObjectClient client = new LargeObjectClient(new BasicHttpBinding(), new EndpointAddress(endPointAddress)); MemoryStream stream = new MemoryStream(); WriteableBitmap wb = new WriteableBitmap(image); wb.SaveJpeg(stream, image.PixelWidth, image.PixelHeight, 0, 100); byte[] byteImage = stream.ToArray(); client.AddImageAsync(new LargeObject.AddImageRequest { Image = byteImage, Latitude = latitude, Longitude = longitude, UserId = Helpers.GetUserId() }); </code></pre> <p>I also tried to configure BasicHttpBinding on client side by set maxRevieved and maxBuffered properties, but it still doesn't work.</p> <p>Any ideas?</p> <p>p.s That's a Windows Azure WCF project, so I have a default endpoint - but I don't know how to set to it maxReceivedMessageSize .</p>
 

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