In this lesson, you set up JAX-WS on the web client to gather database information from the web server. It assumes that you have already set up the Java SE 6 JDK in the C:\Program Files\Java\JDK1.6.0 directory. Note that, at the time of writing, recent versions of the JDK include JAX-WS 2.1.6. To determine if JAX-WS is present, check for a wsimport command in the C:\Program Files\Java\JDK1.6.0\bin directory. If you wish to install a more recent version such as JAX-WS 2.2, then use the following procedure.
Download the latest version of JAX-WS. Go to http://jax-ws.java.net/ to download the latest version.
Follow the online instructions to install JAX-WS. This tutorial assumes that all files are extracted to the C:\Program Files\Java directory.
Add the C:\Program Files\Java\jaxws-ri\bin and C:\Program Files\Java\JDK1.6.0\bin directories to your PATH environment variable in the order listed.
The code used in this tutorial relies on the JDK and JAX-WS binaries. You can write and compile the code from any directory by adding paths to these locations to your PATH environment variable.
Set your CLASSPATH environment variable using the following command:
SET classpath=.;C:\Program Files\Java\jaxws-ri\lib\jaxb-api.jar; C:\Program Files\Java\jaxws-ri\lib\jaxws-rt.jar
Set the JAXWS_HOME environment variable using the following command:
SET JAXWS_HOME=C:\Program Files\Java\jaxws-ri
Override endorsed standards provided by the Java Runtime Environment (JRE). To override the standard run-time environment, create an endorsed directory under the Java Runtime Environment (JRE) lib directory. This is usually C:\Program Files\Java\JDK1.6.0\jre\lib. Do not place the endorsed directory under the JDK lib directory.
Copy the jaxws-ri\lib\jaxws-api.jar and jaxws-ri\lib\jaxb-api.jar files to the C:\Program Files\Java\JDK1.6.0\jre\lib\endorsed directory.
JAX-WS 2.2 provides additional functionality to packaged objects that are not provided in current versions of the JDK. You must override the endorsed standards to make use of this functionality and prevent runtime errors. For more information about the Java Endorsed Standards Override Mechanism, see http://docs.oracle.com/javase/6/docs/technotes/guides/standards/.
Discuter à propos de cette page dans DocCommentXchange.
|Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1|