Please note, that IIS basic authentication must be enabled. By default upon installation and upgrade of LAEMWS this method is disabled.


$email = "mail@example.com";

$soap = new SoapClient("http://localhost:1234/laemws.asmx?wsdl",array('login' => "wsuser",'password' => 'Password', 'domain' => 'localhost')); // change http, localhost, 1234, wsuser, Password to your actual values.

// Get SSO Url
$url = $soap->SSO_GetUrl(
array(
"LiveID"=>$email,
"serviceUrl"=>"http://mail.live.com"
)
);
var_dump($url);

print "<HR>";

// Get Calendar Events
try {
$url = $soap->EWS_Appointment_Select(
array(
"LiveID"=>$email,
"startDate"=>"2010-05-01",
"endDate"=>"2010-12-31"
)
);
var_dump($url);
}
catch(Exception $e)
{
print $e->getMessage();
}

print "<HR>";


// Get ELMS Url
try {
$url = $soap->ELMS_GetUrl(
array(
"LiveID"=>$email
)
);
var_dump($url);
}
catch(Exception $e)
{
print $e->getMessage();
}

print "<HR>";

// Get Email Count
try {
$url = $soap->EWS_Email_GetCount(array("LiveID"=>$email));
var_dump($url);
}
catch(Exception $e)
{
print $e->getMessage();
}
print "<HR>";

// Execute PowerShell Command
try {
$url = $soap->PS_Execute(array("command"=>"get-mailbox a*","domain"=>"studentmail.info"));
var_dump($url);
}
catch(Exception $e)
{
print $e->getMessage();
}
print "<HR>";

Last edited Jun 9, 2010 at 9:11 PM by AntonMamichev, version 3

Comments

tof06 Oct 15, 2010 at 8:22 AM 
For this last example (PowerShell Command), it won't work from PHP (at least, I can't get it working), because PHP SoapClient doesn't support calling of overloaded method.
I described this problem here : http://laemws.codeplex.com/workitem/9