如果我有以下内容:

WSHttpBinding binding = new WSHttpBinding();
EndpointAddress endpoint = new EndpointAddress(new Uri("http://xxx:pppp/MyService"));

MyServiceClient client = new MyServiceClient(binding, endpoint);


如何设置端点bindingConfiguration?如果有帮助,我的app.config设置为:

<endpoint address="http://xxx:pppp/Design_Time_Addresses/WcfServiceLibrary/ManagementService/"
          binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IManagementService"
          contract="ServiceReference.IManagementService">
        <identity>
              <dns value="localhost" />
        </identity>
</endpoint>


但是,我希望让用户在运行客户端之前进行配置。

谢谢

最佳答案

非常简单的修复!抱歉问一个愚蠢的问题!

binding = new WSHttpBinding("WSHttpBinding_IManagementService");

10-06 07:12