Has anyone been able to successfully implement a PHP client for the CMDBuild webservice? I have been trying for a few days to learn with WSO2 WSF/PHP using the example from the webservice documentation but I am not able to get it working at all.
My sample script right now is:
<?php
$RequestPayloadString = <<<XML
<ns1:getCardList xmlns:ns1="http://soap.services.cmdbuild.org">
<className>Department</className>
</ns1:getCardList>
XML;
$url = "http://SERVER:PORT/cmdbuild/services/soap/Webservices";
$Security_options = array ("useUsernameToken" => TRUE);
$Policy = new WSPolicy(array("security" => $Security_options));
$Security_token = new WSSecurityToken(array ("user" => "admin", "password" => "admin", "passwordType" => "Digest"));
$Client = new WSClient(array ("to" => $url, "policy" => $Policy, "securityToken" => $Security_token));
try {
$response = $Client->request($RequestPayloadString);
} catch (Exception $e) {
if ($e instanceof WSFault) {
printf("Soap Fault: %s\n", $e->Reason);
} else {
printf("Message = %s\n",$e->getMessage());
}
}