应用程序服务器提供命令行工具来开发基于 Java™ API for RESTful Web Service (JAX-RS) 规范的 Web service 客户机和实施。在开发 Web Service 之前,必须先设置开发环境。
开始之前
在 WebSphere® Application Server 中设置 Web Service 开发环境之前,必须先安装 WebSphere Application Server。有关安装应用程序服务器的详细信息,请阅读有关安装应用程序服务器环境的相关信息。
要开发 JAX-RS 应用程序,必须将 JAX-RS 库添加到类路径定义。请参阅组装工具的信息以了解如何包含 JAX-RS 应用程序的类路径上的库。
关于此任务
通过完成以下操作来设置 Web service 开发环境。
过程
- 设置环境。
从 /profile_root/<application_server>/bin 目录运行 setupCmdLine.bat 命令。
![[Linux]](../images/linux.gif)
![[AIX]](../images/aixlogo.gif)
![[HP-UX]](../images/hpux.gif)
![[Solaris]](../images/solaris.gif)
诸如 AIX® 或 Linux 之类的操作系统通过从
. /profile_root/<application_server>/bin 目录运行以下命令,将父 shell 的脚本
作为源,以继承导出的变量:
. ./setupCmdLine.sh (Notice the space between
the periods.)
可以将 WAS_USER_SCRIPT 设置为 profile_root\<application_server>\bin\setupCmdLine.bat,它与运行 setupCmdLine 命令具有相同的效果。
在 Qshell 命令行中,从 . /profile_root/bin
目录运行 setupCmdLine 脚本。
从 . /profile_root/<application_server>/bin 目录运行 setupCmdLine 脚本。
![[AIX Solaris HP-UX Linux Windows]](../images/dist.gif)
配置路径。 可以通过输入以下命令,将 WebSphere 和 Java bin 目录添加到您的路径中:![[Windows]](../images/windows.gif)
![[z/OS]](../images/ngzos.gif)
set PATH=%WAS_PATH%;%PATH%
![[AIX]](../images/aixlogo.gif)
![[HP-UX]](../images/hpux.gif)
![[Solaris]](../images/solaris.gif)
![[Linux]](../images/linux.gif)
export PATH=$WAS_PATH:$PATH
结果
可设置环境以便开发 RESTful Web service。
下一步做什么
开发 JAX-RS 应用程序,并为 JAX-RS Servlet 配置
web.xml 文件。