You are here: Web Services > Consuming Web Services > Tutorial 2 - Executing Java Code via Web Services > Testing the File Copy Service

Testing the File Copy Service

You are now going to invoke the file copy service in the example.

Open the Example1.java file

Have a look at the copy method.

The copy method accepts 2 arguments:

Notice that those 2 arguments are annotated with FormParam annotation, which indicates that the parameters are to be specified in the body of the request (in the form of URL encoded key-value pairs).

Let's do a quick test. Launch your web browser again and type the following in the address bar (replace hostname with the name or IP address of your IBM i server):

http://<hostname>:8080/lansa-tutorial/files/copy

You should get the following response.

The error message is expected as our copy method requires two parameters (sourcePath and targetPath), but we haven't specified them. Let's now write our RDMLX reusable parts that invoke the copy service, passing the required parameters.

Next: Writing your RDMLX Base Class for Your Services