hi all,
Running VS.2003 , framework 1.1.
I have a COM object written in Delphi which im trying to call through ASP.NET.
The COM object connects to a folder on another machine and opens a connection
to a foxpro database in that folder. I have a problem with even accessing
that path through SYSTEM.IO.File. EXists and Peter Bromberg suggested
impersonation via LOGONUSER. I have implemented LOGONUSER and now I can
access the file via SYSTEM.IO.File but the problem now is that the COM Object
cannot access that path. I thought it might be impersonation and have left
that implemented but have tried
1. setting <impersonate = "true" in web config
2. setting user name and password to a domain user in machine.config.
I tried creating the object in C# through the following methods
//CODE begin
object o = new object();
o = Server.CreateOb ject("CQSBackOf fice.BOLHandler ");
CQSBackOffice.B OLHandlerClass bb = (CQSBackOffice. BOLHandlerClass ) System.
Runtime.Interop Services.Marsha l.CreateWrapper OfType(o,
typeof(CQSBackO ffice.BOLHandle rClass));
//o.Connect("","" ,"");
bb.UserName = "sup";
bb.Password = "";
bb.Connect("CWT ","data",@"\\se rvername\Client Data\");
string sqq = bb.ReasonText;
Type tServerType = Type.GetTypeFro mProgID("CQSBac kOffice.BOLHand ler");
CQSBackOffice.B OLHandlerClass b = (CQSBackOffice. BOLHandlerClass )
Activator.Creat eInstance(tServ erType);
b.UserName = "sup";
b.Password = "";
b.Connect("CWT" ,"data",@"\\ser vername\Client Data\");
string s = b.ReasonText;
// Create a remote WMSServer object from a System.Type object and
// the CreateObject method.
Type tServerType2 = Type.GetTypeFro mProgID("CQSBac kOffice.BOLHand ler");
CQSBackOffice.B OLHandlerClass b2 = (CQSBackOffice. BOLHandlerClass )Server.
CreateObject(tS erverType2);
b2.UserName = "sup";
b2.Password = "";
b2.Connect("CWT ","data",@"\\se rvername\Client Data\");
string s2 = b2.ReasonText;
// // Create a remote WMSServer object from a System.Type object and a
// // System.Activato r object.
Type tServerType3 = Type.GetTypeFro mProgID("CQSBac kOffice.BOLHand ler");
CQSBackOffice.B OLHandlerClass b3 = (CQSBackOffice. BOLHandlerClass )
Activator.Creat eInstance(tServ erType3);
b3.UserName = "sup";
b3.Password = "";
b3.Connect("CWT ","data",@"\\se rvername\Client Data\");
string s3 = b3.ReasonText;
//CODE End
The .Reason text always returns "access denied" or file related errors.
Now for the killer..
When running Server.Createob ject in VB.NET the code works
So basically,
//pseudo Code begin (VB.NET)
Object x = Server.CreateOb ject("Object.Cl ass")
x.UserName = "sup";
x.Password = "";
x.Connect("CWT" ,"data",@"\\ser vername\Client Data\");
//Code end
The code above works...
I'm looking kinda stupid now because I can't get this to work in C#...
So what is the problem here? Is it that VB.NET does the Wrapper and Binding
in such a way that results in some level of impersonation being passed
through in the Wrapper?
Or is this a VS.2003 bug?
Thanks for any assistance,
Q
--
Message posted via DotNetMonster.c om
http://www.dotnetmonster.com/Uwe/For...p-net/200611/1