一旦部署、组装、部署并配置了 Web Service 后,那么可以进行测试以确认是否在应用程序服务器环境中运行。
开始之前
在测试 Web Service Java™ 客户机以确认 Web Service 在 WebSphere® Application
Server 环境中运行之前,请验证在客户机 Web Service 描述语言 (WSDL) 文件中指定的服务器端点正在运行且可用。
关于此任务
运行测试的方式不同,具体情况取决于客户机模块是否在 Java EE 容器中、客户机是否在 Thin Client for Java API
for XML-based RPC (JAX-RPC) with WebSphere Application
Server 应用程序环境中或是否在 Thin Client for Java API for XML-Based Web Services (JAX-WS)
with WebSphere Application Server 应用程序环境中运行。
过程
- 通过使用 java 命令运行应用程序来测试非受管客户机 JAR 文件。
![[Windows]](../images/windows.gif)
对于 JAX-WS 应用程序:
"%JAVA_HOME%\bin\java"
-Djava.endorsed.dirs=<your_jax-ws_thin_client_install_directory>/endorsed_apis_8.5.0.jar
-classpath
"<your_JAX-WS_thin_client_install_directory>\runtimes\com.ibm.jaxws.thinclient_8.5.0.jar;
<list_of_your_application_jars_and_classes>"
<fully_qualified_class_name_to_run> <your_application_parameters>
![[Windows]](../images/windows.gif)
对于 JAX-RPC 应用程序:
"%JAVA_HOME%\bin\java"
-classpath
"<your_JAX-RPC_thin_client_install_directory>\runtimes\com.ibm.ws.webservices.thinclient_8.5.0.jar;
<list_of_your_application_jars_and_classes>"
<fully_qualified_class_name_to_run> <your_application_parameters>
![[Linux]](../images/linux.gif)
![[z/OS]](../images/ngzos.gif)
对于 JAX-RPC 应用程序:
"$JAVA_HOME/bin/java"
-classpath
"<your_JAX-RPC_thin_client_install_directory>/runtimes/com.ibm.ws.webservices.thinclient_8.5.0.jar:
<list_of_your_application_jars_and_classes>"
<fully_qualified_class_name_to_run> <your_application_parameters>
运行非受管客户机应用程序。
- 测试受管 JAX-RPC 客户机 EAR 文件或非受管 JAX-WS 客户机 EAR 文件。
- 使用 launchClient 命令运行客户机应用程序。 下列示例描述此命令的用法:
launchClient clientEar
结果
您具有已经测试过的支持 Web Service 的客户机。现在,您可以将安全性评测添加到 Web Service。安全性评测是可选的。