### Overall Remote Server API & unified JSP

JReport Enterprise Server allows you to run our JSPs on other machines. For example, you can invoke JReport Enterprise Server interface remotely, so that you can conveniently use the Remote Server API to accomplish your tasks. By using JSPs in your web applications, the Remote Server API enables you to perform report set running tasks remotely, to view the report set result directly from the client side, and to administer JReport Enterprise Server, without having to install JReport Enterprise Server on the client machine.

You can find the Remote Server API in the jet.server.api.rmi package in the JReport Enterprise Server Javadoc located in `<install_root>\help\server\en\api`.

Before using the Remote Server API, you must make sure that:

1. The RMI service is opened in JReport Enterprise Server side.

   Set the server.rmiserver.enable property to true in the server.properties file located in `<install_ root>\bin`.

   When JReport Enterprise Server resides behind a firewall, you need to specify a fixed port in order to pass through the firewall and obtain the remote objects from the client side by setting the server.rmiserver.fixed_port property in the server.properties file.

2. JReport Enterprise Server remote host and port information is passed to the client application.

   Set the following parameters as the JVM environment variables in the client side:

   - Djrs.remote.host=<HOST_NAME/IP_address>
   - Djrs.remote.rmiport=<HOST_PORT>
   - Djrs.rmi.auth_file=<authFileName> (optional)

   You have two alternatives for setting these parameters:

   - You can add `-Djrs.remote.host`, `-Djrs.remote.rmiport` and `-Djrs.rmi.auth_file` (optional) to the batch file that is used to start your application.
   - If you are in an integration environment, you can also add the following to the web.xml file:

         <context-param>
         <param-name>jrs.remote.host</param-name>
         <param-value>127.0.0.1</param-value>
         </context-param>
         <context-param>
         <param-name>jrs.remote.rmiport</param-name>
         <param-value>1129</param-value>
         </context-param>
         <!-- The third param(jrs.rmi.auth_file) is optional. "authFileName" includes the auth
         file's realpath and auth file name. For example: C:\JReport\Server\bin\rmi.auth-->
         <context-param>
         <param-name>jrs.rmi.auth_file</param-name>
         <param-value>C:\JReport\Server\bin\rmi.auth</param-value>
         </context-param>
         <listener>
         <listener-class>jet.server.servlets.JRServerContextListener</listener-class>
         </listener>

#### Administering JReport Enterprise Server remotely

JReport Enterprise Server can be administered from a remote client by Remote Admin Service API. The administration of a JReport Enterprise Server includes cluster administration, resource administration, security administration, configuration, connection pool management, resource alias management, connection information provider service, and catalog information management.

You can find the Remote Admin Service API in the jet.server.api.rmi.admin package available in the JReport Enterprise Server Javadoc which is located in `<install_root>\help\server\en\api`.

Before a JReport Enterprise Server can be performed the remote administration operation on, you need to set the following properties in the server.properties file located in `<install_ root>\bin` in the JReport Enterprise Server side:

- server.rmiserver.enable=true
  Used to open the RMI service.
- server.rmiadminservice.enable=true
  Used to open the administration service in the RMI server. By default this property is set to false and the JReport Enterprise Server does not support remote administration.
- server.rmiserver.fixed_port=<AnOpenedPort>
  Required when JReport Enterprise Server runs behind a firewall.

#### Using single sign-on in RMI client

For implementation in a standalone server, follow the steps below:

1. Write your HttpExternalAuthorized implementation. For details, see Server security - Single sign-on.
2. Compile Java classes. Compiling requires the library JRESServlets.jar, which can be found in `<install_root>\lib` directory.
3. Modify the class path used by your RMI client to include your external authentication classes, so that your application of RMI can access them.

   If it is in an integration environment, you can add the authentication classes in a folder named classes in the WEB-INF folder.

4. Modify the start file of your RMI client to define the system property jrs.httpExternalAuthorized with your implementation.

   For example, assuming that the implementation of this interface is com.mycorp.HttpExternalAuthorizedImpl.class, use the command line to start the RMI client:

   `java -Djrs.httpExternalAuthorized=com.mycorp.HttpExternalAuthorizedImpl ....`

   Then, restart the RMI client.