Hi
here is an example how to connect to SmartServer from PHP:
<?
// we need to specify the 'location' because it points to 'localhost' in the WSDL
$client = new SoapClient('http://ilon-address/WSDL/v4.0/iLON100.wsdl',
array('location' => 'http://ilon-address/WSDL/iLON100.wsdl'));
// read a DP, one can use any request from the 'i.LON SmartServer Programmer’s Reference' here
$dp_data = $client->Read(new SoapVar(
'<Read xmlns="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/">'
. ' <iLonItem>'
. ' <Item>'
. ' <UCPTname>Net/LON/iLON App/Digital Input 1/nvoClsValue_1</UCPTname>'
. ' </Item>'
. ' </iLonItem>'
. '</Read>',
XSD_ANYXML)
)
// show the result
echo $dp_data->iLonItem->Item->UCPTvalue->_;
// the var_dump function can be used to examine properties of the response
var_dump($dp_data);
?>
Note: to not request the iLON100.wsdl and iLON100.xsd files each time they can be saved locally (in the same directory where the script is) and then used as
$client = new SoapClient('iLON100.wsdl', array('location' => 'http://ilon-address/WSDL/iLON100.wsdl'));