hainansyndrome
asked on
IIS7 - (413) Request Entity Too Large | uploadReadAheadSize
I am new to WCF I am writing a WCF Service that has a Data Contract that has a Byte array as a property. WHen I convert a small file it works but when I use a larger image say 1 meg or up I get
The remote server returned an unexpected response: (413) Request Entity Too Large. I need help please
here is my server side web.config
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendl ySynchroni zationCont ext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.serviceModel>
<!--<bindings />-->
<bindings>
<basicHttpBinding>
<binding name="LargeSettings" maxReceivedMessageSize="21 47483647">
<!--maxBufferSize="524288"
maxBufferPoolSize="524288" -->
<!--<readerQuotas maxDepth="32" maxStringContentLength="10 0000"
maxArrayLength="16384" maxBytesPerRead="4096"
maxNameTableCharCount="163 84"
/>-->
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name ="WCFService_VB1.StudentDa ta"
behaviorConfiguration ="ServiceWithMetadata">
<endpoint name="Default"
address="http://www.ortho-sync.com:8080/StudentData.svc"
binding="basicHttpBinding"
bindingConfiguration="Larg eSettings"
contract ="WCFService_VB1.IStudentD ata"/>
<!--<endpoint
address="mex"
binding="mexHttpBinding"
contract="WCFService_VB1.I StudentDat a"/>-->
</service>
</services>
<client />
<behaviors>
<serviceBehaviors>
<behavior name ="ServiceWithMetadata">
<!-- 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 includeExceptionDetailInFa ults="fals e"/>
<dataContractSerializer maxItemsInObjectGraph="214 7483647" />
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding " scheme="https" />
<add binding="basicHttpBinding" scheme="http" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled ="true" multipleSiteBindingsEnable d="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAll Requests=" true"/>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
my client side code is
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version =v4.5" />
</startup>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ISt udentData" maxReceivedMessageSize="21 47483647" />
<binding name="BasicHttpBinding_IHe artbeat" maxReceivedMessageSize="21 47483647" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://www.ortho-sync.com:81/StudentData.svc"
binding="basicHttpBinding" bindingConfiguration="Basi cHttpBindi ng_IStuden tData"
contract="oStudentData.ISt udentData" name="BasicHttpBinding_ISt udentData" />
<endpoint address="http://www.ortho-sync.com:81/StudentData.svc"
binding="basicHttpBinding" bindingConfiguration="Basi cHttpBindi ng_IHeartb eat"
contract="oStudentData.IHe artbeat" name="BasicHttpBinding_IHe artbeat" />
</client>
</system.serviceModel>
</configuration>
The remote server returned an unexpected response: (413) Request Entity Too Large. I need help please
here is my server side web.config
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendl
</appSettings>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.serviceModel>
<!--<bindings />-->
<bindings>
<basicHttpBinding>
<binding name="LargeSettings" maxReceivedMessageSize="21
<!--maxBufferSize="524288"
maxBufferPoolSize="524288"
<!--<readerQuotas maxDepth="32" maxStringContentLength="10
maxArrayLength="16384" maxBytesPerRead="4096"
maxNameTableCharCount="163
/>-->
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name ="WCFService_VB1.StudentDa
behaviorConfiguration ="ServiceWithMetadata">
<endpoint name="Default"
address="http://www.ortho-sync.com:8080/StudentData.svc"
binding="basicHttpBinding"
bindingConfiguration="Larg
contract ="WCFService_VB1.IStudentD
<!--<endpoint
address="mex"
binding="mexHttpBinding"
contract="WCFService_VB1.I
</service>
</services>
<client />
<behaviors>
<serviceBehaviors>
<behavior name ="ServiceWithMetadata">
<!-- 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 includeExceptionDetailInFa
<dataContractSerializer maxItemsInObjectGraph="214
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding
<add binding="basicHttpBinding"
</protocolMapping>
<serviceHostingEnvironment
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAll
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
my client side code is
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version
</startup>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ISt
<binding name="BasicHttpBinding_IHe
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://www.ortho-sync.com:81/StudentData.svc"
binding="basicHttpBinding"
contract="oStudentData.ISt
<endpoint address="http://www.ortho-sync.com:81/StudentData.svc"
binding="basicHttpBinding"
contract="oStudentData.IHe
</client>
</system.serviceModel>
</configuration>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
Please check the below URL, if this can be of any help to you
http://forums.iis.net/t/1169257.aspx
Please check the below URL, if this can be of any help to you
http://forums.iis.net/t/1169257.aspx
ASKER
apeter i still get
The remote server returned an unexpected response: (413) Request Entity Too Large.
The remote server returned an unexpected response: (413) Request Entity Too Large.
Your server contract is this "WCFService_VB1.IStudentDa ta"
and client contract is "oStudentData.IStudentData " and "oStudentData.IHeartbeat".
Two queries
1. Why server contract and client contract missmatching ?
2. Why this address, "http://www.ortho-sync.com:81/StudentData.svc" has two contracts in it ?
and client contract is "oStudentData.IStudentData
Two queries
1. Why server contract and client contract missmatching ?
2. Why this address, "http://www.ortho-sync.com:81/StudentData.svc" has two contracts in it ?
ASKER
oStudentData.IHeartbeat is a 1 way Messaging contract.
I am new to WCF so I am really figuring this out as I go
I am new to WCF so I am really figuring this out as I go
Can you please fix my query 1 and checked ?
ASKER
<bindings>
<basicHttpBinding>
<binding name="LargeSettings"
maxBufferPoolSize="2147483
maxReceivedMessageSize="21
maxBufferSize="2147483647"
<readerQuotas maxDepth="32" maxStringContentLength="10
maxArrayLength="16384" maxBytesPerRead="4096"
maxNameTableCharCount="163
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>