Usina BRAdvPL Guide
Sign in
← All topics
CLASSUnder review

FWRPC

FWRPC():New()

Controls RPC connections and remote execution without a distributed transaction.

FWRPCAdvPL
01 · OVERVIEW

Overview

Documentation covers reconnection, environment preparation and CallProc with up to 26 arguments beyond the routine name. This page does not specify how to supply server or credentials; the example only constructs the object and sets retries and timeout, without invented connection properties. SetTimeOut takes seconds; zero delegates timing to the operating system. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

FWRPC():New()

Methods

SetRetryConnectLimits retries; default 3.o:SetRetryConnect(nRetry)
SetTimeOutSets connection timeout in seconds.o:SetTimeOut(nSeconds)
ConnectConnects to configured destination.o:Connect() -> lResult
SetEnvPrepares remote environment.o:SetEnv(cEmp,cFil,cModulo,aTabelas,cFunName) -> lResult
CallProcReturns remote routine result.o:CallProc(cRotina,...) -> xResult
DisconnectCloses connection.o:Disconnect() -> lResult
03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed450()
    Local oRpc := FWRPC():New()
    // Local configuration: no connection is opened.
    oRpc:SetRetryConnect(1)
    oRpc:SetTimeOut(5)
    FreeObj(oRpc)
Return Nil
Expected result

Configures one retry and a five-second timeout; no remote call. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Check Connect and SetEnv before CallProc. Reconnection guarantees neither idempotency nor rollback of completed effects.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. FWRPC. TDN. Accessed on 2026-10-27.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha