Title: Question about Win32-OLE

Hi Timothy,

Thanks for the response. Here is the error trapping added (changed die to warn) which produces the output as I originally stated.

 

$SFTPServer->connect( $Server, $Port, $UserName, $Password ) or warn "Could not connect as $UserName to $Server:$Port!";

print "Win32::OLE->LastError()."\n"if(Win32::OLE->LastError());

 

If I intentionally provide an incorrect $UserName or $Password I get this:

 

<snip>

Could not connect as Admin to localhost:1000! at C:\Source\SFTPTest.pl line 7

OLE exception from "SFTPCOMInterface.CIServer.1":

 

 [Error:5-'SSL Error']

 

Win32::OLE(0.1703) error 0x80004005: "Unspecified error"

         in METHOD/PROPERTYGET "connect"

<snip>

 

If I intentionally configure the SFTP server to NOT allow connections, I get this:

 

<snip>

Could not connect as Admin to localhost:1000! at C:\Source\SFTPTest.pl line 7

OLE exception from "SFTPCOMInterface.CIServer.1":

 

 [Error:2-'Remote Admin disallowed']

 

Win32::OLE(0.1703) error 0x80004005: "Unspecified error"

         in METHOD/PROPERTYGET "connect"

<snip>

 

I suspect that when the Error 2 or 5, does NOT appear, then the parameters are being received correctly by the server COM interface. But the connection is still failing. The Error 2 and 5 appears to be correctly reporting the test conditions, again, the parameters appear to be okay. Thus my conclusion is that this is way beyond me ;-) Possibly something in the OLE internals?

 

The server vendor has some old perl code samples that use the ancient OLE (not Win32::OLE) package. That package uses CreateObject() instead of  new() methods. Could be something hinky here, too. Bottom line, it seems like if it works in VBS it should also work in perl. I hate to kludge my ftp client with a lot of VBS unless I have to.

 

Again, thanks for the assist and regards,

Sturdy

 

 


From: Timothy Johnson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 24, 2006 4:15 PM
To: [EMAIL PROTECTED]; perl-win32-users@listserv.ActiveState.com
Subject: RE: Question about Win32-OLE

 

Are you sure that the connect method is returning a non-zero value on success?  What happens if you take out the die clause?

 

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Wednesday, May 24, 2006 11:59 AM
To: perl-win32-users@listserv.ActiveState.com
Subject: Question about Win32-OLE

 

Hi all,

I am having a problem accessing a commercial SFTP server app (non-MS). My code is below. I can instantiate the object but the connect method refuses to establish the connection.

use Win32::OLE;
my $Server = "localhost";
my $Port =  "1000";
my $UserName = "Admin";
my $Password = "Admin";
my $SFTPServer = Win32::OLE->new("SFTPCOMInterface.CIServer");
$SFTPServer->connect( $Server, $Port, $UserName, $Password ) or die "Could not connect as $UserName to $Server:$Port!";

The above simple script throws this error:
Could not connect as Admin to localhost:1000! at C:\Source\SFTPTest.pl line 7.

I feel the parameters are being accepted because if I change $UserName or $Password, then I get a msg that logon failed.

These same parameters work in this VBS:
Set SFTPServer = WScript.CreateObject("SFTPCOMInterface.CIServer")
      txtServer = "localhost"
      txtPort = "1000"
      txtUserName = "Admin"
      txtPassword = "Admin"
SFTPServer.Connect txtServer, txtPort, txtUserName, txtPassword

Does anyone have a clue as to what might be going wrong? There seems to be an issue with OLE itself but this is beyond me.

Thanks again and best regards,
Sturdy

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to