Skip to content

pbSuppressLastError - cClientWebService

Determines if a web-service call error should be reported

Type: Property
Access: Read/Write
Data Type: Boolean
Parameters: None

Syntax

Property Boolean pbSuppressLastError
Access Type Syntax
Read Access: Get pbSuppressLastError to BooleanVariable
Write Access: Set pbSuppressLastError to BooleanVariable/Value

Description

A web-service call which results in an error will send the message LastError. pbSuppressLastError determines if LastError should report an error. When False, the default, an error is reported. When True, the error is suppressed and LastError does nothing. If you choose to suppress the error, you will want to handle the error reporting yourself. You can check the status of your last web-service call with the peTransferStatus property. You can report any errors by setting pbSuppressLastError to True and calling LastError or by creating your own error handler.

Set pbSuppressLastError of oWSCustomerService to True
Get wsCustomerName of oWSCustomerService to sName
Get peTransferStatus of oWSCustomerService to eTransferStatus
If (eTransferStatus=wssOK) Begin
    Send AddNewName sName
End
Else Begin
    // Handle soap fault errors in a special way. Report all others as errors.
    If (eTransferStatus=wssSoapFault) Begin
        Get TransferErrorDescription of oWSCustomerService to sErr
        Send WeHadAFaultError sErr
    End
    Else Begin
        Set pbSuppressLastError of oWSCustomerService to False
        Send LastError of oWSCustomerService // this will generate an error
    End
End

See Also

psFaultCode | psFaultString | peTransferStatus | TransferErrorDescription | LastError