Hi
I am trying to access a webservice through plugin and it works fine until I try to set a proxy server. I am using the following code to set the proxy
//Create the SOAP binding for call
BasicHttpBinding binding = new BasicHttpBinding();
binding.Security.Mode = BasicHttpSecurityMode.Transport;
binding.UseDefaultWebProxy = false;
binding.ProxyAddress = new Uri(proxyServerUrl);
soapclient = new SoapClient(binding, new EndpointAddress(new Uri(serviceUrl)));
This works fine with my test client and uses the proxy and gets data from service, but when deployed as plugin it throws an exception. This is CRM Online and plugin running under sandbox mode.
System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Is there anyway proxy can be set?
Thanks