<send>

VoiceXML 1.0 only; Experimental Extension. Submits values to a web server without transitioning to a new VoiceXML document.

Syntax

 <send
     url="URI"
     expr="js_expression"
     method="get"|"post"
     enctype=MIME_type
     namelist="variable1 ..."
     fetchtimeout="time_interval"
     fetchaudio="URI"
 />

Description

Note: VoiceXML 2.0 applications should use the BeVocal VoiceXML extension <data> tag instead of this tag.

This tag submits the specified data to a web server; when the web server returns a successful HTTP result code, execution of the current document continues with the tag following the <send>. This tag is useful when you need to save data (for example, the result of a <record>) in a database but do not need to transfer to a new document.

The servlet or CGI script document to which <send> submits data must return a valid HTTP reply, including headers and at least one blank line indicating the end of the headers.

If the returned HTTP result code does not indicate success, an error.badfetch is thrown to signal a server error to the VoiceXML application. That application can catch the error and play an error message or take some other action to alert the user.

Note: VoiceXML 2.0 applications should use the BeVocal VoiceXML extension <data> tag instead of this tag. This tag is obsolete and will be removed in a future release of BeVocal VoiceXML.

Attribute Description
url

URI to which to submit the values. Optional (as alternative to expr).

expr

A JavaScript expression that evaluates to the URI to which to submit the values. Optional (as alternative to next).

method

The query request method. Optional (default is get).

enctype

MIME encoding of the submitted document. Optional (default is application/x-www-form-urlencoded).

The supported types are:

 •  application/x-www-form-urlencoded
 •  multipart/form-data

The type multipart/form-data is more efficient when submitting large amounts of binary data.

namelist

Space-separated list of variables to submit. Optional (default is to submit all input variables that have been given explicit names with the name attribute of <field>, <record>, <transfer>, or <subdialog>).

This attribute can specify any variable currently in scope, both VoiceXML variables and JavaScript variables, including shadow variables and other variables that have not been explicitly declared.

A variable set to a JavaScript object is submitted as the individual component values; see Submitting Complex JavaScript Objects.

fetchtimeout

Specifies the interval to wait for the resource to be returned before throwing a error.badfetch event. See Handling Fetching Delays. Optional.

fetchaudio

Specifies the URI of an audio clip to play while a resource is being fetched. See Background Audio. Optional.

Tip:

 •  If a JavaScript expression contains any of the characters "<", ">", or "&", that character must be replaced with the corresponding escape sequence "&lt;", "&gt;", or "&amp;". For more information, see JavaScript Quick Reference.

Usage

Parents Children
<bevocal:foreach>
<block>
<catch>
<error>
<filled>
<help>
<if>
<noinput>
<nomatch>

None.

See Also

 •  Related tags: <submit>

Example

 <?xml version="1.0" ?>
 <!DOCTYPE vxml PUBLIC "-//BeVocal Inc//VoiceXML 1.0//EN"
  "http://cafe.bevocal.com/libraries/dtd/vxml1-0-bevocal.dtd">
 
 <vxml version="1.0">
   <form id="form-record">
     <field name="name" type="boolean">
       <prompt>
         Say yes to send your data to Snoop Servlet or no to exit
       </prompt>
       <filled>
         <if cond="name">
           <send method="post" url="http://www.yoursite.com/SomeServlet"/>
           <prompt>Data sent successfully!</prompt> 
         </if>
         <prompt> Good bye! </prompt>
         <exit/>
       </filled>
     </field>
   </form>
 </vxml>

[Show Frames]   [FIRST] [PREVIOUS] [NEXT]
BeVocal, Inc. Café Home | Developer Agreement | Privacy Policy | Site Map | Terms & Conditions
Part No. 520-0001-02 | © 1999-2007, BeVocal, Inc. All rights reserved | 1.877.33.VOCAL