Page 1 of 1
Pardon n00bish issue with submit / post
Posted: Thu Feb 10, 2011 8:59 pm
by Wyzyrd606
I have a lot more experience with php than vxml, so sorry for cluttering the board, but not sure where to turn next
This validates and works:
Code: Select all
<vxml version="2.0" xml:lang="en-US">
−
<form>
<var name="uid" expr="9999"/>
<var name="event_id" expr="2"/>
<var name="contact_id" expr="3"/>
−
<block>
−
<prompt>
−
<audio src="welcome.wav">
This is a scheduled message from XXX.
</audio>
</prompt>
−
<prompt>
here is your message from XXX XXX. This is a test message
</prompt>
</block>
−
<field name="healthstatus">
−
<grammar>
one|two|three|four|five|very good|good|fair|bad|verybad
</grammar>
−
<prompt>
−
<audio src="wav/welcome.wav">
how do you feel today? one, very good, two, good, three, fair, four, bad, five, very bad.
</audio>
</prompt>
</field>
−
<block>
<submit method="post" next="http://www.xxx.xxx/demo/xxx/services/writeresponse.php" namelist="uid event_id contact_id healthstatus "/>
</block>
</form>
</vxml>
the writeresponse program returns more XML to say goodbye, and call ends correctly
However, inside writeresponse.php, $_POST (and $_GET, for that matter) are empty arrays . I'm screwing something up, obviously, but have been unable to tell what.
Thanks in advance for any assistance.
Re: Pardon n00bish issue with submit / post
Posted: Thu Feb 10, 2011 9:00 pm
by Wyzyrd606
BTW, the extraneous dashes are an artifact of cutting and pasting from browser, not sent in the VXML
Re: Pardon n00bish issue with submit / post
Posted: Fri Feb 11, 2011 9:15 am
by support
Hi,
It looks like your code is working correctly, we copied and pasted your exact code from above, and created our own writeresponse.php file and ran some tests, and all variables came through as $_POST vars correctly. Below are the 2 files we used to test this issue.
healthstatus.php
Code: Select all
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0" xml:lang="en-US">
<form>
<var name="uid" expr="9999"/>
<var name="event_id" expr="2"/>
<var name="contact_id" expr="3"/>
<block>
<prompt>
<audio src="welcome.wav">
This is a scheduled message from XXX.
</audio>
</prompt>
<prompt>
here is your message from XXX XXX. This is a test message
</prompt>
</block>
<field name="healthstatus">
<grammar>
one|two|three|four|five|very good|good|fair|bad|verybad
</grammar>
<prompt>
<audio src="wav/welcome.wav">
how do you feel today? one, very good, two, good, three, fair, four, bad, five, very bad.
</audio>
</prompt>
</field>
<block>
<submit method="post" next="writeresponse.php" namelist="uid event_id contact_id healthstatus "/>
</block>
</form>
</vxml>
writeresponse.php
Code: Select all
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
<form>
<block>
<prompt>
The variables are: <?=$_POST['uid']?> , <?=$_POST['event_id']?> , <?=$_POST['contact_id']?> , and <?=$_POST['healthstatus']?>.
Goodbye!
</prompt>
</block>
</form>
</vxml>
Let us know if you continue to experience any problems.
Regards,
Plum Support
Re: Pardon n00bish issue with submit / post
Posted: Fri Feb 11, 2011 10:38 am
by Wyzyrd606
Thanks -
I tested it out and it appears that PHP version differences between my local dev machine and the server are my issue - the var_export function was outputting empty arrays on the server. a foreach on $_POST got correct values. Thanks
While attempting to solve the problem, though, I did find another issue that I cannot explain:
in the same sendcall output during vxml validation, replacing the submit construct with send:
i.e. <send method='post' url='
http://www.xxx.com/demo/xxx/writeresponse.php' etc......>
validation returns:
This document is not valid VoiceXML!
No declaration for attribute method of element send in Entity, line: 15
when the order of the attributes is experimentally-swapped
i.e. <send url='
http://www.xxx.com/demo/xxx/writeresponse.php' method='post' etc......>
validation returns:
This document is not valid VoiceXML!
No declaration for attribute url of element send in Entity, line: 15
it appears that the first attribute is not being seen correctly ?
we are also preparing to port some legacy vxml apps that currently use nuance:send to post data, so being able to use send in place of submit/next and wait for response would be preferable in most cases.
Re: Pardon n00bish issue with submit / post
Posted: Fri Feb 11, 2011 10:43 am
by support
Hi,
Unfortunately, our platform does not support the <send> tag, so that's why your seeing those errors. For a list of all the tags we do support, please see our developer documentation:
http://www.plumvoice.com/docs/dev/voicexml:tags
Thanks,
Plum Support
Re: Pardon n00bish issue with submit / post
Posted: Fri Feb 11, 2011 11:33 am
by Wyzyrd606
That would explain it
Thanks again for your help