peXmlTransferStatus - cXmlHttpTransfer
Returns the status of the last xml http request
Type: Property
Access: Read/Write
Data Type: Integer
Parameters: None
Syntax
Property Integer peXmlTransferStatus
| Access Type | Syntax |
|---|---|
| Read Access: | Get peXmlTransferStatus to IntegerVariable |
| Write Access: | Set peXmlTransferStatus to IntegerVariable/Value |
Description
peXmlTransferStatus returns the status of the last xml http request. You should use this value to determine if your transfer was successful.
Possible return values are:
| Constant | Meaning |
|---|---|
| xtsOk | Request succeeded |
| xtsHttpRequestFailed | Http request failed |
| xtsBadRequest | Bad or missing data sent |
| xtsInvalidContentType | Invalid contentType received |
| xtsNoData | No data was received |
| xtsNotXml | Received data not in proper XML format |
| xtsError | Unspecified error |
If an XML/HTTP request fails, the return XML handle will be 0 and peXmlTransferStatus will contain a status code. Note that an error is not automatically generated. It is expected that you will want to check the peXmlTransferStatus after your request and handle any failures in your code. If you wish, you can send LastError to generate an error. Or, you can get TransferErrorDescription to return a description of problem.
Get HttpPostXmlNode of hoHttp "dataaccess.com" "MyApp/stuff.asp" hoSentXml to hoRcvdXml
If (hoRcvdXml=0) Begin // if no data came back, probably and error
Get peXmlTransferStatus of hoHttp to eStatus
If (eStatus=xtsOk) Begin
Send DoNoDataWasReturned
End
Else if (eStatus=xtsNotXml) Begin
Send DoCustomNotXMLError // if not xml, do custom error
End
Else Begin
Send LastError of hoHttp // all other errors reported by LastError
End
End
The xtsHttpRequestFailed Status
If the response was xtsHttpRequestFailed, this indicates that there is something wrong with your HTTP transfer. If you need to determine more detailed information about the HTTP error you can use LastErrorCode and ResponseStatusCode) to get more information about the HTTP transfer failure.
See Also