C# 在wcf basicHttpBinding中设置手动代理

C# 在wcf basicHttpBinding中设置手动代理,c#,wpf,wcf,data-binding,C#,Wpf,Wcf,Data Binding,下面是我设置用户指定代理地址的代码 private Binding GetBinding() { BasicHttpBinding basicHttpBinding = new BasicHttpBinding(BINDING_CONFIG_NAME); basicHttpBinding.UseDefaultWebProxy = false; basicHttpBinding.BypassProxyOnLocal = true; basicHtt

下面是我设置用户指定代理地址的代码

  private Binding GetBinding()
   {
     BasicHttpBinding basicHttpBinding = new BasicHttpBinding(BINDING_CONFIG_NAME);
     basicHttpBinding.UseDefaultWebProxy = false;
     basicHttpBinding.BypassProxyOnLocal = true;
     basicHttpBinding.ProxyAddress = new Uri("http://10.222.22.22:3988");
     return basicHttpBinding;
   }
我不断得到错误的Uri格式错误。设置手动代理地址的正确方法是什么? 而且,如果我使用默认IE代理设置进行测试,它工作得很好。谢谢

编辑:下面是设置端点的代码

 ApptServiceClient client = new ApptServiceClient
            (GetBinding(), new EndpointAddress(this.Uri));
            client.Open();

你什么时候拿到的?你也可以发布你正在设置端点的部分。@Incognito我刚刚编辑了我的问题。谢谢。您在哪里得到异常?最后,我发现这是代理服务器端的问题。我的代码运行正常。很抱歉给您添麻烦。谢谢。那么你可以结束这个问题了吗?