web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Insufficient permissions for setting the configuration section 'defaultProxy' while consuming REST API in Plugins

(0) ShareShare
ReportReport
Posted on by

First, I tried to connect external Rest API through console and was able to connect and send the data. Now, I am trying to consume the same in Plugin but no luck.

I have read so many blogs, was informed to change the isolation mode from sandbox to None. As we are using "ONLINE", I could not.

If any one has alternatives, Kindly, please let me know.

Thanks in Advance!

Code :

HttpWebRequest webrequest = (HttpWebRequest)WebRequest.Create("XXX");
webrequest.Method = "POST";
webrequest.ContentType = "application/json";
webrequest.Headers.Add("Authorization", "YYY");

string customer = "{\"isperson\":\"" + "false" + "\",\"companyname\":\"" + "Customer 2" + "\"}";

using (var streamWriter = new StreamWriter(webrequest.GetRequestStream()))
{

streamWriter.Write(customer);
streamWriter.Flush();
streamWriter.Close();

var httpResponse = (HttpWebResponse)webrequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var result = streamReader.ReadToEnd();
}

}

INNER EXCEPTION : InnerException {"Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."} System.Exception


EXCEPTION MESSAGE : Insufficient permissions for setting the configuration section 'defaultProxy'

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: Insufficient permissions for setting the configuration section 'defaultProxy' while consuming REST API in Plugins

    Hi,

    Take a look at this blog: www.magnetismsolutions.com/.../sending-web-requests-to-a-rest-api-from-a-microsoft-dynamics-365-plugin

    Hope this helps.

  • Manish_Dyanamics Profile Picture
    40 on at
    RE: Insufficient permissions for setting the configuration section 'defaultProxy' while consuming REST API in Plugins

    Did you find any solution here?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#2
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans