Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.
Image Removed

 Image Added 

The copy method accepts 2 arguments:

  • sourcePath
  • targetPath

 Image Added Image Removed

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 IBM i server):http

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

You should get the following response.Image Removed

 Image Added 

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