Hi,
I am developing a plugin which calls a web service but i am getting this error:
Insufficient permissions for setting the configuration section 'defaultProxy'. I am setting my proxy credentials using code like so:
WebService service = new WebService();
NetworkCredential credentials = new NetworkCredential("username", "password", "domain");
WebProxy proxy = new WebProxy();
proxy.Credentials = credentials;
service.Proxy = proxy;
I tried to generate a proxy class using SvcUtil.exe but the error still appears.
SubmitTransactionRequestBody body =
new SubmitTransactionRequestBody("param1", "param2", "param3", "param4", param5, "param6");
SubmitTransactionRequest req = new SubmitTransactionRequest(body);
BasicHttpBinding myBinding = new BasicHttpBinding();
myBinding.Name = "serviceSoap";
myBinding.Security.Mode = BasicHttpSecurityMode.None;
myBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
myBinding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;
myBinding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
EndpointAddress endPointAddress = new EndpointAddress("serviceUrl");
ChannelFactory<serviceSoap> factory = new ChannelFactory<serviceSoap>(myBinding, endPointAddress);
serviceSoap channel = factory.CreateChannel();
SubmitTransactionResponse res = channel.SubmitTransaction(req);
factory.Close();
string requestResponse = res.Body.SubmitTransactionResult.ToString();
I tested both methods on a Console Application and its working fine. I don't know where i am missing it.
The version of CRM is 2015, it's hosted on premise, the isolation mode is None, and assembly is stored in database. See screenshot below

*This post is locked for comments
I have the same question (0)