Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
This thread is related my my another thread: [^]
In my project, the web.config likes that below:
XML
<?xml version="1.0"?>
<configuration>
  
  <appSettings>
     ...
  </appSettings>
  
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_ITransInfo" maxBufferPoolSize="2147483647"
            maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" />
        <binding name="BasicHttpBinding_ITransInfoJson" maxBufferPoolSize="2147483647"
            maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" />
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://xxx.com/WSMonument/TransInfo.svc.svc" binding="basicHttpBinding"
          bindingConfiguration="BasicHttpBinding_ITransInfo" contract="ITransInfo"
          name="BasicHttpBinding_ITransInfo" />
      <endpoint address="http://xxx.com/WSMonument/TransInfo.svc.svc" binding="basicHttpBinding"
          bindingConfiguration="BasicHttpBinding_ITransInfoJson" contract="ITransInfoJson"
          name="BasicHttpBinding_ITransInfoJson" />
    </client>
    
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

How wen I debug, the Client.dll.config throut WCF Test Client's Config Files shows the content below:
<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_ITransInfo" />
            <binding name="BasicHttpBinding_ITransInfoJson" />
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://localhost:35104/TransInfo.svc" binding="basicHttpBinding"
            bindingConfiguration="BasicHttpBinding_ITransInfo" contract="ITransInfo"
            name="BasicHttpBinding_ITransInfo" />
        <endpoint address="http://localhost:35104/TransInfo.svc" binding="basicHttpBinding"
            bindingConfiguration="BasicHttpBinding_ITransInfoJson" contract="ITransInfoJson"
            name="BasicHttpBinding_ITransInfoJson" />
    </client>
</system.serviceModel>

This one does NOT define the max. message size. When running the debugging, it picks up the default max. message size: 65536, and the endpoint address is localhost... rather than the address entered. Of course, it causes failure.
My Q here is how to make the Client.dll.config have the content in my web.config to have the defined max. message size as high as 2147483647? Thanks if you can help.
Posted
Updated 14-Dec-15 8:02am
v3
Comments
s yu 14-Dec-15 14:27pm    
Problem solved by referring to https://msdn.microsoft.com/en-us/library/bb552364%28v=vs.110%29.aspx. The procedure is below:
1) In WCF Test Client, from Tools->Options->Client Configuration tab, check-offAlways Regenerate Config When Launching Services option.
2) Edit the configuration through the WCF test Client.
3) Save it.
Thanks for your review.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900