WebReceive (XmlDoc function): Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{Template:XmlDoc:WebReceive subtitle}} | |||
[[Category:XmlDoc methods|WebReceive function]] | [[Category:XmlDoc methods|WebReceive function]] | ||
[[Category:XmlDoc API methods]] | [[Category:XmlDoc API methods]] | ||
Line 18: | Line 18: | ||
deserialization is successful or a non-zero value if unsuccessful and | deserialization is successful or a non-zero value if unsuccessful and | ||
the ErrRet option is used and the particular error is tolerated. | the ErrRet option is used and the particular error is tolerated. | ||
==Syntax== | |||
{{Template:XmlDoc:WebReceive syntax}} | |||
===Syntax terms=== | |||
<dl> | <dl> | ||
Line 33: | Line 32: | ||
<dt>fldNam | <dt>fldNam | ||
<dd>The name of the form field associated with the | <dd>The name of the form field associated with the | ||
"<input type=file>" tag in the HTML form, that is, | |||
the value of the | the value of the "name" parameter in that tag. | ||
See the | See the "fieldname" argument of $Web_Proc_Recv in the &JANWEBR.. | ||
<dt>fldOcc | <dt>fldOcc | ||
<dd>The number of the form field associated with the | <dd>The number of the form field associated with the | ||
"<input type=file>" tag in the HTML form. | |||
See the | See the "occurrence" argument of $Web_Proc_Recv in the &JANWEBR.. | ||
<dt>options | <dt>options | ||
<dd>See the | <dd>See the "options" argument of | ||
??[[LoadXml (XmlDoc/XmlNode function)|LoadXml]]. | ??[[LoadXml (XmlDoc/XmlNode function)|LoadXml]]. | ||
Line 56: | Line 55: | ||
</dl> | </dl> | ||
==Usage notes== | |||
<ul> | <ul> |
Revision as of 16:58, 22 January 2011
Deserialize Web request into this XmlDoc (XmlDoc class)
[Requires Janus SOAP]
WebReceive is a member of the XmlDoc class.
This callable function converts an HTTP request received on a Janus Web Server thread from the text representation of an XML document to an XmlDoc tree (this process is called deserialization, because the text representation of a document is called the serial form). It returns a zero value if the deserialization is successful or a non-zero value if unsuccessful and the ErrRet option is used and the particular error is tolerated.
Syntax
[%errorPosition =] doc:WebReceive[( [formFieldname], [fieldOccurrence], - [options])] Throws XmlParseError
Syntax terms
- %pos
- A %variable set to 0 if the deserialization is successful, or, if the ErrRet option is used, to the position within the uploaded data at which an error is found.
- doc
- An expression that points to the XmlDoc to contain the deserialized representation of the XML document.
- fldNam
- The name of the form field associated with the "<input type=file>" tag in the HTML form, that is, the value of the "name" parameter in that tag. See the "fieldname" argument of $Web_Proc_Recv in the &JANWEBR..
- fldOcc
- The number of the form field associated with the "<input type=file>" tag in the HTML form. See the "occurrence" argument of $Web_Proc_Recv in the &JANWEBR..
- options
- See the "options" argument of ??LoadXml.
Exceptions
This function can throw the following exception:
- XmlParseError
- If the method encounters a parsing error, properties of the exception object may indicate the location and type of problem. See ?? refid=xmlpars..
Usage notes
- See the LoadXml function ?? reftxt='Usage Notes' refid=unlxml..
Example
The following Janus Web Server program uses WebReceive to obtain the XML document from the HTTP request:
Begin %d Object XmlDoc %d = New %d:WebReceive %d2 Object XmlDoc %d2 = New %d2:LoadXml('<sum>' With - %d:Value('/*/*[1]') + %d:Value('/*/*[2]') - With '</sum>') %d2:WebSend End
Request-Cancellation Errors
- XmlDoc is not EMPTY.
- Option is invalid.
- Insufficient free space exists in CCATEMP.
- A syntax error occurred in the text string representation of the XML document (these are tolerated if the ERRRET option is specified).