Click here to Skip to main content
11,710,472 members (87,251 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WCF
Hi Guys

I have a web service that I want to send an object that contains a file.

The problem I am getting is that it keeps complaining with a 403 error (Request Entity To Large).

In my app's Web.config I have the following:
<bindings>      
     <basicHttpBinding>
       <binding name="RFServiceSoap" />
       <binding name="BasicHttpBinding_IFeedbackFormService"
             maxBufferSize="6553600"
             maxBufferPoolSize="524288"
             maxReceivedMessageSize="6553600">
         <readerQuotas maxDepth="32" maxStringContentLength="100000"
                       maxArrayLength="16384" maxBytesPerRead="4096"
                       maxNameTableCharCount="16384" />
         <security mode="None" />
       </binding>
        <binding name="BasicHttpBinding_IFeedbackFormService1" />
      </basicHttpBinding>
  </bindings>
  <client>
      <endpoint address="http://localhost:50047/RFService.asmx" binding="basicHttpBinding" bindingConfiguration="RFServiceSoap" contract="RFServices.RFServiceSoap" name="RFServiceSoap" />
      <endpoint
        address="http://localhost/RedfernServices.FeedbackFormService.svc?wsdl"
        binding="basicHttpBinding"
        bindingConfiguration="BasicHttpBinding_IFeedbackFormService"
        contract="FeedbackService.IFeedbackFormService"
        name="RedfernService"
      />
      <!--bindingConfiguration="BasicHttpBinding_IFeedbackFormService"-->
    </client>
  <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>

Then in my web.config (and I've tried the app.config too) on the WCF service has the following:
<system.serviceModel>
   <behaviors>
     <serviceBehaviors>
       <behavior name="">
         <serviceMetadata httpGetEnabled="true" />
         <serviceDebug includeExceptionDetailInFaults="false" />
       </behavior>
 

 
       <behavior name="ServiceWithMetadata">
         <serviceMetadata httpGetEnabled="true" />
         <serviceDebug includeExceptionDetailInFaults="false" />
       </behavior>
 
       <behavior>
         <!-- To avoid disclosing metadata information,
         set the values below to false before deployment -->
         <serviceMetadata httpGetEnabled="True" httpsGetEnabled="True" />
         <!-- 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 -->
         <serviceDebug includeExceptionDetailInFaults="False" />
      </behavior>
     </serviceBehaviors>
   </behaviors>
 

   <bindings>
     <basicHttpBinding>
       <binding name="LargeSettings"
            maxBufferSize="6553600"
            maxBufferPoolSize="524288"
            maxReceivedMessageSize="6553600">
         <readerQuotas maxDepth="32" maxStringContentLength="100000"
                       maxArrayLength="16384" maxBytesPerRead="4096"
                       maxNameTableCharCount="16384" />
         <security mode="None" />
       </binding>
     </basicHttpBinding>
   </bindings>
 
   <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
 
   <services>
     <service name="RedfernServices.FeedbackFormService"
              behaviorConfiguration="ServiceWithMetadata">
       <endpoint address=""
                 binding="basicHttpBinding"
                 bindingConfiguration="LargeSettings"
                 contract="RedfernServices.IFeedbackFormService">
         <identity>
           <dns value="localhost" />
         </identity>
       </endpoint>
       <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
       <host>
         <baseAddresses>
           <add baseAddress="http://localhost:8733/Design_Time_Addresses/RedfernServices/Service1/" />
         </baseAddresses>
       </host>
     </service>
   </services>
 
 </system.serviceModel>

After looking on that there tinterweb, I came to the conclusion that what I have should do the trick. But its not. Frown | :(

My service and ASP.NET web forms app are both running .NET 4.0. Can anybody see what I have done wrong?

Any help would be greatly appreciated.

Thanks
Posted 27-Mar-13 0:03am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi Paul,

I have answered the same question about two weeks ago. I suggest your problem has something to do with the maximmum size of the message. For further details, see here[^].


cheers,
Marco Bertschi
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 549
1 OriginalGriff 270
2 Peter Leow 134
3 Abhinav S 130
4 Richard MacCutchan 80
0 Abhinav S 60
1 Member 4653839 40
2 barneyman 35
3 Sergey Alexandrovich Kryukov 35
4 Member 11793820 35


Advertise | Privacy | Mobile
Web01 | 2.8.150819.1 | Last Updated 27 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100