tags:

views:

23

answers:

0

Google App Inventor has some information in their documentation for setting up a sample TinyWebDB webservice using python or app engine, however, I'm trying to use php. Is this possible? I've followed directions posted here but all I get is the error:

Communication with the web service encountered a protocol exception

I display this error in a label component on the when TinyWebDB1.WebServiceError block.

So here is what I have in my php files:

getvalue.php

header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 2010 05:00:00 GMT');
header('Content-type: application/json');

$retval = array("VALUE", "tagged", '"'.time().'"'); 
echo json_encode($retval);

Which returns:

["VALUE","tagged","\"1283093117\""]

setvalue.php

$tag = $_POST['tag'];
$value = $_POST['value'];
$retval = array("STORED", '"'.$tag.'"', '"'.$value.'"');
echo json_encode($retval);

Which returns:

["STORED","\"tagged\"","\"testdata\""]

Thanks for any suggestions or answers.