thybag/PHP-SharePoint-Lists-API — pull request #10 by Quix0r (2012-12-07 13:23:44+00:00)
Title: Correct HTTP header usage + SOAPAction header added

I have now fixed the correct usage of HTTP headers in NTLM_SoapClient class + I added support for $action variable in callCurl() method of same class. Maybe the action is not correct, I just handle it over from SoapClient.

So far what the other VersionMismatch error is about, PHP seems to send an other XML, try this perl (!) script:

use LWP::UserAgent;
use LWP::Debug;
use SOAP::Lite on_action => sub { "$_[0]$_[1]"; };
import SOAP::Data 'name', 'value';
our $sp_endpoint = 'http://server-host/some_path/_vti_bin/Lists.asmx?WSDL';
#our $sp_domain = 'teams1.sharepoint.hp.com:80';
our $sp_domain = 'DOMAIN';
our $sp_username = 'DOMAIN\\username';
our $sp_password = 'pa$$w0rd';

$debug = 1;

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);
$soap->schema->useragent($schema_ua);
$soap->uri("http://schemas.microsoft.com/sharepoint/soap/");

$lists = $soap->GetListItems();
quit(1, $lists->faultstring()) if defined $lists->fault();

my @result = $lists->dataof('//');
foreach my $data (@result) {
my $attr = $data->attr;
foreach my $a qw/listName viewName query/ {
printf "%-16s %s\n", $a, $attr->{$a};
}
print "\n";
}

sub SOAP::Transport::HTTP::Client::get_basic_credentials { return ($sp_username => $sp_password) };