Our file copy implementation so far does the required functionality, however if something is wrong (e.g. the source file doesn't exist), it doesn't tell you what's wrong. So we are going to add the code to retrieve the error message from our Java code.
The Java code sends out a JSON object at the end of the copy operation that indicates the status of the invocation. When you are creating your own service later on, make sure that you follow the same pattern. The status consists of two values:

We are going to create a reusable part called ExternalServiceInvocationStatus to represent the invocation status. You will use this reusable part in all your services.

Place the following code in the new reusable part:
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_OBJT)