3

I have a wcf service

there is a method which gets base64 string to upload a file my file's size 100kb it may be larger in time

i got the error message: The remote server returned an error: (413) Request Entity Too Large while try to get HttpWebResponse

this is my wcf service web.config

<system.serviceModel> <bindings> <webHttpBinding> <binding name="webHttpTransportSecurity" allowCookies="false" maxReceivedMessageSize="104857600"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" /> <security mode="Transport"> <transport clientCredentialType="None" /> </security> </binding> </webHttpBinding> </bindings> <services> <service name="FHServices.FHSmartService" behaviorConfiguration="ServiceBehaviour"> <endpoint address="" binding="webHttpBinding" contract="FieldHoundServices.IFHSmartService" behaviorConfiguration="web"> </endpoint> <host> <baseAddresses> <add baseAddress="http://localhost/FHServices/FHSmartService.svc/" /> </baseAddresses> </host> </service> </services> <behaviors> <serviceBehaviors> <behavior name="ServiceBehaviour"> <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> <endpointBehaviors> <behavior name="web"> <webHttp /> </behavior> </endpointBehaviors> </behaviors> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> </system.serviceModel> 

what is my mistake?


solved

i found my mistake i remove these codes

<security mode="Transport"> <transport clientCredentialType="None" /> </security> 

i think transport mode for https and we have no ssl so we dont need transport mode. anyway after i remove it, everything seems ok now

4

1 Answer 1

1

You don't assign a defined WebHttpBinding configuration to your endpoint, so the endpoint uses the default values for the binding.

You can tell the endpoint to use your binding congfiguration by specifying it in the bindingConfiguration attribute on the <endpoint> element, like this:

<endpoint address="" binding="webHttpBinding" bindingConfiguration="webHttpTransportSecurity" contract="FieldHoundServices.IFHSmartService" behaviorConfiguration="web"> </endpoint> 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.