WebReceive (XmlDoc function)
Deserialize Web request into this XmlDoc (XmlDoc class)
[Requires Janus SOAP]
WebReceive 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; it returns a non-zero value if deserialization is unsuccessful and the ErrRet option is used and the particular error is tolerated.
[%errorPosition =] doc:WebReceive[( [formFieldname], [fieldOccurrence], - [options])] Throws XmlParseError
|%errorPosition||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.|
|formFieldName||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.|
|fieldOccurrence||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.|
|options||See the options argument of LoadXml.|
This function can throw the following exception:
- If the method encounters a parsing error, properties of the XMLParseError exception object may indicate the location and type of problem.
- See the LoadXml function.
The following Janus Web Server program uses WebReceive to obtain the XML document from the HTTP request:
This list is not exhaustive: it does not include all the errors that are request cancelling.
- The doc object is not EMPTY.
- An options argument 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).
- To deserialize a string, use LoadXml.
- The subroutine that serializes an XmlDoc and sends it as a Web response is WebSend.