WinHttp.WinHttprequest.5.1 ASP.Net 3.5

Hi,

I am trying to connect to a credit card processing company using

WinHttp.WinHttprequest.5.1

However this is giving me the following error:

Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Is this due to medium trust? Is there anyway to get around this?
 
that would be medium trust, I will be able to check this and the efflare issue in several more hours.

I am not at a point I can login and check these items now. (I am on public wifi with some port blocking, and for security I'd prefer not to try to get around it)
 
Can I ask why you're using this component rather than the default .NET System.Net.HttpWebRequest functionality? I don't see any obvious advantages.
 
It doesn't use COM to do it's job, and it's more tailored to the .NET way of doing things, but I'm pretty sure it would get the job done.
That being said, I think some other thread said something about not allowing outgoing socket connections in .NET at all..
..okay, I tested it, and it works fine on win24 at least: http://www.subbot.net/misc/Test.aspx

The page fetches www.google.com and outputs the result. Images and postbacks won't work of course. Can't expect too much from 6 lines of code :)

Anyway, I've done successful payment gateway integration with HttpWebRequest without too much trouble. Doubt this one would be very different.

Code:
using System;
using System.IO;
using System.Net;

public partial class misc_Test : System.Web.UI.Page
{
	protected void Page_Load(object sender, EventArgs e)
	{
		HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("http://www.google.com/");
		HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
		StreamReader sr = new StreamReader(webResponse.GetResponseStream());
		Response.Write(sr.ReadToEnd());
		webResponse.Close();
		Response.End();
	}
}
 
Back
Top