Показать сообщение отдельно
Старый 16.12.2016, 08:56   #2  
Pandasama is offline
Pandasama
Участник
 
464 / 140 (5) +++++
Регистрация: 11.08.2014
Адрес: Барнаул
Собственно, первый вопрос решился примерно вот таким образом. А второй не столь актуален для меня.
X++:
MyNamespace.MyServiceType                                               _client;
ClrObject                                                               clientType;
System.ServiceModel.Description.ServiceEndpoint                         endPoint;
System.ServiceModel.BasicHttpBinding                                    binding;
System.ServiceModel.BasicHttpSecurity                                   security;
System.ServiceModel.BasicHttpSecurityMode                               securityMode;
System.ServiceModel.HttpTransportSecurity                               httpTransportSecurity;
System.ServiceModel.HttpProxyCredentialType                             httpProxyCredType;
System.Uri                                                              proxyUri;

...

clientType = CLRInterop::getType("MyNamespace.MyServiceType");
_client = AifUtil::CreateServiceClient(clientType);

endPoint = _client.get_Endpoint();

binding = endPoint.get_Binding();

binding.set_UseDefaultWebProxy(false);

proxyUri = new System.Uri("http://proxy.site.ru:8080");
binding.set_ProxyAddress(proxyUri);

security = binding.get_Security();
httpTransportSecurity = security.get_Transport();
httpProxyCredType = System.ServiceModel.HttpProxyCredentialType::Windows;
httpTransportSecurity.set_ProxyCredentialType(httpProxyCredType);

security.set_Transport(httpTransportSecurity);
binding.set_Security(security);
endPoint.set_Binding(binding);
За это сообщение автора поблагодарили: Maxim Gorbunov (2), Logger (3).