Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: using perl to read in details from a sharepoint site

by rodneyrods (Initiate)
on Jun 30, 2009 at 10:58 UTC ( [id://775978]=note: print w/replies, xml ) Need Help??


in reply to Re^3: using perl to read in details from a sharepoint site
in thread using perl to read in details from a sharepoint site

Sorry still new to this! Here is the code, I have replaced the double-quotes with single, the error I now receive is "DIE!!!:401 Unauthorized at sp_scraper2.pl line 59":
use HTML::Entities; use LWP::UserAgent; use LWP::Debug; use SOAP::Transport::HTTP; use SOAP::Lite on_action => sub { "$_[0]$_[1]"; }; import SOAP::Data 'name', 'value'; our $sp_endpoint = 'http://oursharepointsite.aspx'; our $sp_domain = 'http://oursharepointdomain:80'; our $sp_username = "my valid account"; our $sp_password = "my account password"; if ($debug) { LWP::Debug::level('+'); SOAP::Lite->import(+trace => 'all'); } my @ua_args = (keep_alive => 1); my @credentials = ($sp_domain, "", $sp_username, $sp_password); my $schema_ua = LWP::UserAgent->new(@ua_args); $schema_ua->credentials(@credentials); $soap = SOAP::Lite->proxy($sp_endpoint, @ua_args, credentials => \@cre +dentials); my $ie="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"; my $ua = LWP::UserAgent->new; $ua->agent($ie); my $url = 'http://oursharepointsite.aspx'; my $response = $ua->get ($url); my $content; if ($response->is_success) { print "$response->content\n"; } else { die "DIE!!!:". $response->status_line; } exit;

Replies are listed 'Best First'.
Re^5: using perl to read in details from a sharepoint site
by strider corinth (Friar) on Sep 18, 2009 at 16:59 UTC

    It looks to me like you're setting up your $soap object and then not using it to actually make your first call. Instead, you're building a new LWP user agent without any credentials associated with it, and using that.

    Try replacing everything from the line starting 'my $ie=' with the following:

    use Data::Dumper; $soap->transport->credentials( @credentials ); # you probably don't n +eed this my $call= $soap->GetListCollection(); die $call->faultstring() . "\n" . Dumper( $call->faultdetail() ) . "\n +" . $call->faultactor() . "\n" if defined $call->fault();
    - John
Re^5: using perl to read in details from a sharepoint site
by roboticus (Chancellor) on Jul 10, 2009 at 22:44 UTC
    rodneyrods:

    Sorry, but I've played around with it and haven't figured out how to make it authenticate properly either. Hopefully someone else will step in...

    ...roboticus

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://775978]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-24 20:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found