ASP to ASP.Net COM Component issue

J

jeremymcnitt

Hi, I looked through the groups, and couldn't find what I was looking
for, and was wondering if anyone here could help me out. I am newish
to ASP.Net and was presented a problem that I don't know how to
resolve.

The problem is I have two websites, each with it's own log in method.
I am trying to make it so that I log into one, it logs into the other.

One site is traditional ASP/VB6, the other is ASP.Net.

I have exposed the login methods from the ASP.Net site and am trying to
call them from the ASP site. I've created an ASP.Net COM component,
which I call from my ASP page. I have successfully created the COM
object, and it's all COM registered.

The COM Component calls the ASP.Net code to write all the correct
cookies, and session variables.

That's where it's not working. I can successfully call the COM object
from the ASP page, I pass in the Response, and the Request Object.

My ASP.Net code needs an HttpContext object.

I have to accept in the COM object the ASP Response, and ASP Request as
Objects. I've tried everything I can think of to get them converted to
ASP.Net HttpRequest and ASP.Net HttpResponse objects.

I would like to do something similar to:

ASP Code:
Dim oOtherSiteInterop
Set oOtherSiteInterop = CreateObject("Interops.OtherSite")
Call oOtherSiteInterop.CreateCookies(Request, Response, sUserID,
sPassword)

COM Code:
public void CreateCookies(object request, object response, string
lName, string lPass)
{
HttpRequest req = (HttpRequest)request;
HttpResponse res = (HttpResponse)response;
HttpContext context = new HttpContext(req, res);
OtherSiteObject bob = new OtherSiteObject();
bob.LoginUser(context, lName, lPass);
}

This isn't working.

Does anyone have a suggestion? Keep in mind before replying that this
may or may not be the best way to do this, but I really need to try to
make this work, before I scrap it and do something that I'm obviously
missing that is more simple.

Thanks much in advance,
Jeremy McNitt
 
J

jeremymcnitt

I should mention why it isn't working.

The ASP Response and ASP Request objects do not convert into ASP.Net
HttpRequest and ASP.Net HttpResponse objects.

It throws an error, then the object bails out and reports a failure to
the ASP page, which then gives a generic ASP does not support
Automation error.
 
E

Edwin Knoppert

We have a similar situation ASP calling an ASP.NET app.
We managed it by using a tempfile having a userid inside.
The ASP.NET opens the file and removes it, it uses the id to authenticate
the user with that id by checking the same DB.
The tempfile should be created outside the wwwroot dir.
The tempfilename was passed in the URL.
Since the temp is removed you can not reuse it (as should)
Btw, we send the filename without path, make it as difficult as you like :)
 
J

jeremymcnitt

I'll try that, but is there a way to do this without having to create a
temp file? Is it possible to somehow convert the ASP Request, and ASP
Response into an ASP.Net HttpRequest, and an ASP.Net HttpResponse so
that I may create an ASP.Net HttpContext object? I just need the COM
component to write the cookie, are there other ideas out there?

Thanks for the help Edwin, and others.

Jeremy McNitt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top