Hi,
I am trying to send a request from plugin using the HttpWebRequest but it gives me the exception below about the permission of the type 'System.Net.WebPermission...'.
The code is
//RequestHandler is a class which sends the HttpWebRequest and login() takes 3 parameters and return the message if it was accepted or not
RequestHandler logObj = new RequestHandler();
string webResponse = logObj.login("786","786","42005");
//I print that in a task activity
Entity followup = new Entity("task");
followup["subject"] = "The Phone number of the Customer: "+phone1;
followup["description"] ="The Web Response of The Service: " +webResponse;
The Exception which RequestHandler returns is
System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.Net.HttpWebRequest.CheckConnectPermission(Uri uri, Boolean needExecutionContext)
at System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint)
at System.Net.HttpRequestCreator.Create(Uri Uri)
at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
at Microsoft.Crm.Sdk.Samples.RequestHandler.login(String agentId, String password, String extension)
The action that failed was:
Demand
The type of the first permission that failed was:
System.Net.WebPermission
The Zone of the assembly that failed was:
MyComputer
The snapshot of Activity Task in CRM
Figure 1.0

Is there any way of getting the permission so I can send request,
if its not possible that way then is there any alternative way of doing this?
Thanks,