Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

using perl to read in details from a sharepoint site

by rodneyrods (Initiate)
on Jun 23, 2009 at 00:37 UTC ( [id://773805]=perlquestion: print w/replies, xml ) Need Help??

rodneyrods has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to use perl to read in the contents into an array from a sharepoint site that I have set up at work - however I am getting transport protocol and bad hostname errors. Can anyone help with this? I have no issues reading from other web pages but can't get it to work against sharepoint pages. Please help!
  • Comment on using perl to read in details from a sharepoint site

Replies are listed 'Best First'.
Re: using perl to read in details from a sharepoint site
by Anonymous Monk on Jun 23, 2009 at 00:47 UTC
    Can anyone help with this?

    You have network issues, nothing you can do about it , except maybe flush dns cache, retry

Re: using perl to read in details from a sharepoint site
by roboticus (Chancellor) on Jun 23, 2009 at 15:29 UTC
    rodneyrods:

    Unfortunately, you're not giving specific enough information. Please add details and you should probably get more and better help. Remember, vague problem statements with vague questions will often result in useless answers.

    <example>

    Now, to answer your question:

    Can anyone help with this?

    Yes, I'm certain someone can help.

    </example>

    ;^D

    ...roboticus
      Hi. Sorry it was vague. Here is the code that we are trying to use to read in the data from the sharepoint site (I've removed the company specific info etc). 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 address of our sharepoint site.aspx"'; our $sp_domain = '"http address of our sharepoint domain:80"'; our $sp_username = "one of our valid accounts"; our $sp_password = "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 => \@credentials); my $ie="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"; my $ua = LWP::UserAgent->new; $ua->agent($ie); my $url = '"http address of our sharepoint site.aspx"'; my $response = $ua->get ($url); my $content; if ($response->is_success) { print "$response->content\n"; } else { die "DIE!!!:". $response->status_line; } exit; When we run the script the error returned is: proxy: transport protocol not specified For info we have our proxy configs set locally on our pcs and the site we are trying to access is not accessed via proxy server - our credentials are enough to access via the web but not via the script. Can anyone help?
        rodneyrods:

        Please put code tags1 around your code blocks. Just so I can read it, I'll copy a couple of lines of your code into this node and put the code tags on it.

        our $sp_endpoint = '"http address of our sharepoint site.aspx"'; our $sp_domain = '"http address of our sharepoint domain:80"';

        Looking at the code, it appears that the extra quotes might be your problem. Have you tried removing the double-quotes and trying it again?

        NOTES:

        1 You can do so like this: <code> ... your code ... </code>

        ...roboticus

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-23 04:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found