endurox.tpcall¶
- endurox.tpcall(svc: str, idata: object, flags: int = 0) endurox.TpReply¶
Synchronous service call. In case if service returns
TPFAILorTPEXIT, exception is not thrown, instead first return argument shall be tested for the tperrno for 0 (to check success case).tpcall example¶# Call service with UBF buffer tperrno, tpurcode, retbuf = e.tpcall("EXBENCH", { "data":{"T_STRING_FLD":"Hi Jim"}}) if e.TPESVCFAIL==tperrno: e.tplog_warn("Service failed") e.tplog_debug("Service responded %s" % retbuf["data"]["T_STRING_2_FLD"][0])
For more details see tpcall(3).
- Raises:
AtmiException –
Following error codes may be present:TPEINVAL- Invalid arguments to function.TPEOTYPE- Output type not allowed.TPENOENT- Service not advertised.TPETIME- Service timeout.TPESVCERR- Service failure during processing.TPESYSTEM- System error.TPEOS- System error.TPETRAN- Target service is transactional, but failed to start the transaction.TPEITYPE- Service error during input buffer handling.- Parameters:
svc (str) – Service name to call
idata (dict) – Input ATMI data buffer
flags (int) – Or’d bit flags:
TPNOTRAN,TPSIGRSTRT,TPNOTIME,TPNOCHANGE,TPTRANSUSPEND,TPNOBLOCK,TPNOABORT.
- Returns:
int – tperrno - error code
int – tpurcode - code passed to tpreturn(3) by the server
dict – ATMI buffer returned from the server.