none
problem in send large file into wcf RRS feed

  • Question

  • hi

    i'll send a text file with 80kb  size to wcf service ,but i get this error :

    the remote server returned an unexpected response (400) bad request

    but when i send a text file with 50 byte size it's correct

    i use this code in web.config in server

    <system.web>
        <httpRuntime maxRequestLength="2097151" />
        <compilation debug="true" targetFramework="4.0" />
      </system.web>
    
     <bindings>
          <basicHttpBinding>
            <binding name="FileSenderService.StreamedBinding"
                         transferMode="StreamedRequest" maxBufferSize="65536"
                         maxReceivedMessageSize="2000000000" messageEncoding="Mtom"
                         receiveTimeout="00:10:00">
            </binding>
          </basicHttpBinding>
        </bindings>

    and use this code in Client :

    <binding name="BasicHttpBinding_ISendEmailService" closeTimeout="01:00:00"
              openTimeout="01:00:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
              allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
              maxBufferSize="2000000000" maxBufferPoolSize="2000000000" maxReceivedMessageSize="2000000000"
              messageEncoding="Text" textEncoding="utf-8" transferMode="StreamedRequest"
              useDefaultWebProxy="true">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="UserName" algorithmSuite="Default" />
              </security>
            </binding>


    it's urgent

    please help me for solve it

    thanks

    Monday, April 7, 2014 12:11 PM

Answers

  • Hi,

    From your description, it seems the value of some properties are not big enough, please try increase the value of properties inside <readerQuotas> for both Server& Client. See more about <readerQuotas> at http://msdn.microsoft.com/en-us/library/ms731325(v=vs.110).aspx

    In addtion, please make sure the configuration of Client side is in accordance with the Server's. It is messageEncoding="Mtom"
     in your service, but it is messageEncoding="Text" in your client.

    If the issue still exists, please try configure tracing for your service, so that we can get more details to troubleshoot the issue.

    #Configuring Tracing

    http://msdn.microsoft.com/en-us/library/ms733025(v=vs.110).aspx

    Thanks


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, April 8, 2014 3:05 AM
    Moderator
  • thanks for your help

    Tuesday, April 8, 2014 4:12 AM

All replies

  • Hi,

    From your description, it seems the value of some properties are not big enough, please try increase the value of properties inside <readerQuotas> for both Server& Client. See more about <readerQuotas> at http://msdn.microsoft.com/en-us/library/ms731325(v=vs.110).aspx

    In addtion, please make sure the configuration of Client side is in accordance with the Server's. It is messageEncoding="Mtom"
     in your service, but it is messageEncoding="Text" in your client.

    If the issue still exists, please try configure tracing for your service, so that we can get more details to troubleshoot the issue.

    #Configuring Tracing

    http://msdn.microsoft.com/en-us/library/ms733025(v=vs.110).aspx

    Thanks


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, April 8, 2014 3:05 AM
    Moderator
  • thanks for your help

    Tuesday, April 8, 2014 4:12 AM