none
C# - SOAP webservice fails when string variable is too large RRS feed

  • Question

  • Hi everyone, just to post a problem that we've now identified which baffed 4 of us for a day.

    Long story, but we have a website which talks to a webservice that then talks to SSRS, and the webservice then prints the output from reporting services.

    This failed for us, when it turns out, one string variable passed onto the report was 71 characters long. Truncating it to 60 (the length of another item which came out of reporting services correctly) allowed the procedure to work as we expected.

    Now, using the full 71 characters directly into the webservice works fine, so my question is there something we've missed that would break the call between the website and webservice?

     

    • Moved by Caillen Friday, March 28, 2014 3:09 AM
    Thursday, March 27, 2014 11:22 PM

Answers

  • Hi,

    By default the data can be transfered between the service and client is 64kb. So in order to transfer more large data, the following changes needed to be done.

    First you have to set a maxRequestLength to a larger value in your httpRuntime element to run the request for longer period, if you host the service in IIS:

    <system.web>    
    <httpRuntime maxRequestLength="102400" />
    </system.web>
    
    

    Then please try to modify your client and service config file as following:

    <bindings>
      <basicHttpBinding>
        <binding name="basichttpbindingname"
          transferMode="Streamed"
          maxReceivedMessageSize="10067108864"
          maxBufferSize="500000" maxBufferPoolSize="500000">
          <readerQuotas
            maxDepth="32"
            maxStringContentLength="2147483647"
            maxArrayLength="2147483647"
            maxBytesPerRead="4096"
            maxNameTableCharCount="16384" />
        </binding>
      </basicHttpBinding>
    </bindings>
    Also please do not forget to apply the binding configuration to your endpoint:
     <endpoint address="" 
               binding="basicHttpBinding" 
               bindingConfiguration="basichttpbindingname"
               contract="yoursericecontract"/>


    Best Regards,
    Amy Peng


    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.


    Monday, March 31, 2014 2:52 AM
    Moderator

All replies

  • Hi David,

    Welcome to post in MSDN  forums.

    Questions about WebService need to be posted in WCF forum, I'm moving it here for better responses.

    Thanks for your understanding.


    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.


    • Edited by Caillen Friday, March 28, 2014 3:11 AM
    Friday, March 28, 2014 3:11 AM
  • Hi,

    By default the data can be transfered between the service and client is 64kb. So in order to transfer more large data, the following changes needed to be done.

    First you have to set a maxRequestLength to a larger value in your httpRuntime element to run the request for longer period, if you host the service in IIS:

    <system.web>    
    <httpRuntime maxRequestLength="102400" />
    </system.web>
    
    

    Then please try to modify your client and service config file as following:

    <bindings>
      <basicHttpBinding>
        <binding name="basichttpbindingname"
          transferMode="Streamed"
          maxReceivedMessageSize="10067108864"
          maxBufferSize="500000" maxBufferPoolSize="500000">
          <readerQuotas
            maxDepth="32"
            maxStringContentLength="2147483647"
            maxArrayLength="2147483647"
            maxBytesPerRead="4096"
            maxNameTableCharCount="16384" />
        </binding>
      </basicHttpBinding>
    </bindings>
    Also please do not forget to apply the binding configuration to your endpoint:
     <endpoint address="" 
               binding="basicHttpBinding" 
               bindingConfiguration="basichttpbindingname"
               contract="yoursericecontract"/>


    Best Regards,
    Amy Peng


    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.


    Monday, March 31, 2014 2:52 AM
    Moderator
  • Thanks for that Amy - I'm fairly sure that we don't go over that size, but it is worth a try! I will hopefully get some time to see if it works later this wek.

    Thanks!

    Monday, March 31, 2014 9:55 PM