It's finally time to write your RDMLX code.
You are going to use XPRIM_UriBuilder to build your URL, and XPRIM_RandomAccessJsonReader to read the JSON response.
Create a new server module called GoogleTranslateServerModule and declare the required fields:
Begin_Com Role(*EXTENDS #PRIM_SRVM)
 
End_Com
Define the following fields at the beginning:
Define Field(#TargetLanguage) Type(*NVARCHAR) Length(10)
Define Field(#SourceLanguage) Type(*NVARCHAR) Length(10)
Define Field(#SourceText) Type(*NVARCHAR) Length(500)
Define Field(#TranslatedText) Type(*NVARCHAR) Length(500)
Define Field(#ErrorCode) Type(*NVARCHAR) Length(50)
Define Field(#ErrorMessage) Type(*NVARCHAR) Length(200)
Define Field(#OK) Type(*BOOLEAN)
Create a new server routine called Translate:
Srvroutine Name(Translate)
 
Endroutine
Add the following input and output parameters to the server routine: