Installing the RPC adapter libraries

The RPC adapter for IBM® WebSphere® Application Server is provided as a standalone package. Let us assume that <install_root> is the directory where WebSphere Application Server is installed,

Standalone Library:
The IBM RPC adapter is provided as a stand-alone library in the <install_root>/optionalLibraries/web2mobile/RPCAdapter directory. Note that you also need to create and add a RpcAdapterConfig.xml file in the WEB-INF directory.

The standalone library can be used with Web applications or Enterprise Applications that need to invoke methods of JavaTM objects from JavaScriptTM.  Installation of this library is dependent on how the application that uses it is packaged and implemented.  A few general scenarios are provided.

Java Platform, Enterprise Edition (Java EE) Web application:

  1. Place the RPCAdapter.jar file in the WEB-INF/lib directory of the Web application containing the Java objects that you want to make accessible.
  2. Configure the web.xml file so that the servlet com.ibm.websphere.rpcadapter.RPCAdapter is exposed under the Web address: http://<host>:<port>/<contextRoot>/RPCAdapter/*. Add the following servlet configuration to your web.xml file: <servlet> <display-name>RPCAdapter</display-name> <servlet-name>RPCAdapter</servlet-name> <servlet-class>com.ibm.websphere.rpcadapter.RPCAdapter</servlet-class> </servlet> <servlet-mapping> <servlet-name>RPCAdapter</servlet-name> <url-pattern>/RPCAdapter</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>RPCAdapter</servlet-name> <url-pattern>/RPCAdapter/*</url-pattern> </servlet-mapping> This is for routing all calls to the application with RPC adapter in the URL to the com.ibm.websphere.rpcadapter.RPCAdapter servlet.
  3. Create a RpcAdapterConfig.xml and place it in the WEB-INF folder.
    Specify the POJO that are exposed through RPC adapter in the configuration file. An example of a basic configuration that exposes a TestService follows: <rpcAdapter xmlns="http://www.ibm.com/xmlns/prod/websphere/featurepack/v6.1/RpcAdapterConfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <default-format>xml</default-format> <pojo> <name>TestService</name> <implementation>com.ibm.test.TestService</implementation> <description>bean provides ...</description> <!-- optional --> </pojo> </rpcAdapter>
  4. Start the application server.
  5. Package and deploy the Web application. Refer to the application server specific documentation on instructions for packaging and deploying a Web archive (WAR) or Enterprise archive (EAR) file.
  6. Use the following directory of URLs to interact with the RPC adapter for information and RPC:
  7. Use Dojo to invoke the services exposed through RPC adapter using the dojo.rpc.JsonService script. Refer to the Dojo documentation on detailed usage information.



Terms of Use | Feedback