Subject: | 401 Unauthorized on cp only |
Date: | Tue, 7 Oct 2014 16:34:04 +0000 |
To: | "bug-SharePoint-SOAPHandler [...] rt.cpan.org" <bug-SharePoint-SOAPHandler [...] rt.cpan.org> |
From: | "FINNEGAN, JAMES" <jf3579 [...] att.com> |
Hi, hoping you can help. I am able to use the modules you have written to display information on the Shared Documents sharepoint. However when I go to copy anything I'm getting a 401 Unauthorized error. Here is the output from my script where you can see it dumped the fdls contents correctly (There is 1 file out on the sharepoint), but then the error on the cp? If you can think of anything I'm doing wrong please let me know.
#!/usr/bin/perl
use Authen::NTLM qw(ntlmv2);
use Data::Dumper;
use SharePoint::SOAPHandler;
use CopyTree::VendorProof;
use CopyTree::VendorProof::LocalFileOp;
delete $ENV{'https_proxy'};
my $sharepointobj = SharePoint::SOAPHandler ->new;
my $localfileobj = CopyTree::VendorProof::LocalFileOp ->new;
$sharepointobj->sp_creds_domain('operations.web.myworksite.com:443');
$sharepointobj->sp_creds_user('MYDOMAIN\myuserid');
$sharepointobj->sp_creds_password('Mypassword');
$sharepointobj->sp_authorizedroot('https://operations.web.myworksite.com:443/sites/CAPCOET3/Jimboski');
my $cpobj = CopyTree::VendorProof ->new;
print Dumper $sharepointobj->fdls('', 'Shared Documents');
$cpobj -> src('/opt/app/Reports/Excel/Reports_TABS1007.xlsx', $localfileobj);
$cpobj -> dst('Shared Documents/Reports_TABS1007.xlsx', $sharepointobj);
$cpobj -> cp;
print Dumper $sharepointobj->fdls('', 'Shared Documents');
Response:
$VAR1 = 'Shared Documents/Reports_TABS1006.xlsx';
$VAR2 = 'Shared Documents/Forms';
401 Unauthorized at /opt/app/perl/lib/perl5/SharePoint/SOAPHandler.pm line 374.