Discussion forum about Comet system products
You are not logged in.
Hello,
I have : H4531 - Intelligent temperature probe with Ethernet interface and relay outputs
Firmware version: 04.03 / 1-5-2.01
Web version: 4.01
I activate the SOAP sender, the diagnostic page show that everything is ok:
Cnt (req/ok): 21/21
Err. cnt (sock/req1/req2): 0/0/0
Last code (req1/req2): 100/200
File SOAP: ok
I use the sample .php code from documentation:
<?
function InsertH4531($passKey, $device, $temp, $alarms, $re1, $re2, $in1, $in2, $in3, $inAlarms, $compType, $timer)
{$data = "Time: ".StrFTime("%y/%m/%d %H:%M:%S", Time()).", Temp: ".$temp.", Input 1: ".$in1.", Input 2: ".$in2.", Input 3: ".$in3."\n";
$file_write = FOpen("soap.log", "a");
FWrite($file_write, $data);
FClose($file_write);}
$server = new SoapServer(null, array('uri' => "http://test-uri/")); (edit: in this line SoapServer must to be Soap Server, for my case. But now I've got parse error for this line)
$server->addFunction('InsertH4531');
$server->handle();
?>
I manualy create soap.log. But the file still remain empty.
Please help me, what I am doing wrong.
I use WinXP, wamp server(Apache 2.2.11+PHP5.2.9).
What I want to do at the end, to be able to record the values into a MySQL data base.
Thank you.
Marin Constantin
Last edited by Visitor (18-03-2009 14:08:08)
Offline
Hi,
your SOAP service is wrong, try this:
<? function InsertHx5xxSample($passKey, $device, $temp, $relHum, $compQuant, $pressure, $alarms, $re1, $re2, $in1, $in2, $in3, $inAlarms, $compType,$tempU, $pressureU, $timer) { $data = "Time: ".StrFTime("%y/%m/%d %H:%M:%S", Time()).", Temp: ".$temp.", RH: ".$relHum.", CV: ".$compQuant. ", Pressure: ".$pressure."\n"; $file_write = FOpen("soap.log", "a"); FWrite($file_write, $data); FClose($file_write); } $server = new SoapServer(null, array('uri' => "http://test-uri/")); $server->addFunction('InsertHx5xxSample'); $server->handle(); ?>
See new version of SDK: http://cometsystem.cz/english/manuals/i … xx-apx.pdf
John
Offline
Thank you for your help.
I try it but still soap.log is empty. I modify the SoapServer to Soap Server after I check soap with phpinfo().
I add the php after <?, so from <? ... ?>, become <?php...?>, before and after still soap.log file is empty. But in <?php...?> configuration I've got parse error in line 8-line with "...new Server Soap"
I check with wireshark, the transmiter send the XML/post...exactly like in documentation.
I know that I am doing something wrong...I not able to figure out what. Also it's my first time when I try something like this.
If somebody can give some hints I will apreciate.
Best regards,
Marin Constantin
Offline
Problem solved.
I believe it was a Copy - > Paste issue.
The code is ok, from documentation. But I let it between <?php...?> brackets.
Thank you for support.
Best regards.
Marin Constantin
Offline