Why is my WCF Service not loading my Binding config?

前端 未结 2 992
自闭症患者
自闭症患者 2021-02-14 12:11

I have the problem with the following error: \"The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceived

2条回答
  •  青春惊慌失措
    2021-02-14 12:46

    WCF does not import all settings from your server. There's no switch to turn that on, either. While it might make sense in many cases, it wouldn't always be a good idea to just duplicate all settings from the server-side to the client.

    So in your case, what you need to do is add that binding configuration to your client side proxy, too, and reference it from your client endpoint.

    If you control both ends of the wire, you can ease your work a bit: externalize the binding configuration into a separate file and reference it.

    So create a file bindings.config that contains:

    
    
        
            
      
    
    

    and then you can copy that file both into the server and the client project, and reference it from within your service and client config:

    
        
        
          
            
            
          
        
    

    and on your client side:

    
        
        
            
                
                    
                
            
        
    
    

    That way, you can have your configuration for the bindings done once, and used in both places.

提交回复
热议问题