WSHttp binding and ReliableSession / MaxRetryCount

后端 未结 1 1480
隐瞒了意图╮
隐瞒了意图╮ 2020-12-18 13:10

When using a WSHttpBinding in WCF with reliableSessions enabled, my service reference updates itself to:



        
1条回答
  •  一个人的身影
    2020-12-18 13:33

    You cannot set the maxRetryCount on a standard wsHttpBinding configuration. In order to set that value, you need to create a separate custom binding and then reference that from your service or client config:

      
        
          
            
              
              
              
            
          
        
        
          
            
          
        
      
    

    Defining a custom binding isn't hard - but you need to make sure you specify the elements that make up the binding in the right order - see the MSDN docs on custom bindings for a reference.

    If you want to share the custom binding configuration between server and client, you could also put that section into a separate bindings.config file, and then reference that external file from your web.config/app.config:

      
        
    

    Visual Studio will complain about this and show red squiggly underlines - but trust me - the technique works, I use it in production every day (the Visual Studio XML schema describing the config stuff isn't complete and accurate).

    Marc

    0 讨论(0)
提交回复
热议问题