This topic inludes the source code for the Readme.html Sample.
This sample is located in the following directory in your WebLogic Workshop installation:
BEA_HOME/weblogic81/samples/workshop/SamplesApp/ProxyClient/register/
<html> <head> <title> RegisterClient.java: WebLogic Workshop Web Service Client Proxy Example </title> <style type="text/css"> h1, h2, h3, h4, p, li, blockquote { font-family: Verdana, Arial, Helvetica, sans-serif; margin-left: 0px; } h1 { font-size: 150%; } h2 { font-size: 130%; } p, li { font-size: 12; } blockquote { font-size: 12; } blockquote { margin-left: 1em; } ul { list-style-type: square; } </style> </head> <body> <h1>RegisterClient.java: WebLogic Workshop Web Service Client Proxy Example</h1> <h2>Introduction</h2> <p> This sample demonstrates how to create a Java client for a Workshop web service. In particular, it demonstrates how to interact with a conversational web service and how to manipulate compound Java types used in the web service's interface. RegisterClient.java is a client for the web service defined in WL_HOME/samples/workshop/SamplesApp/WebServices/proxy/register/RegisterPerson.jws.</p> <p>RegisterClient.java is a standalone Java application that accesses the web service through the web service proxy. The proxy for any given WebLogic Workshop web service is available from that service's Test View on the Overview page by clicking the <b>Java Proxy</b> link. The proxy classes are packaged in a web service-specific JAR file. To use the proxy, you also need the generic webserviceclient.jar that you can obtain by clicking the <b>Proxy Support Jar</b> on the Overview page of a web service's Test View. link.</p> <a name="Environment"></a> <h2>Environment</h2> <p>In order to run this sample, the following must be true:</p> <ul> <li> The <b>WL_HOME</b> environment variable must be set to BEA_HOME/weblogic81, where BEA_HOME is the "bea" directory in which the WebLogic Platform is installed. </li> <li> <b>ant</b> must be on your PATH. <b>ant</b> is delivered with WLS and can be found in WL_HOME/server/bin. Please make sure that directory is on your PATH. </li> <li> <b>java</b> must be on your PATH. <b>java</b> is delivered with WLS and can be found in BEA_HOME/jdk141_03/bin. Please make sure that directory is on your PATH. </li> </ul> <h2>Contents</h2> <blockquote> <b>build.xml</b> <blockquote> ant script that compiles the RegisterClient standalone Java console client.<br> </blockquote> </blockquote> <blockquote> <b>RegisterClient.java</b> <blockquote> standalone Java application that is a client of RegisterPerson.jws. See comments in the file for explanation of the details of writing a web service Java client.<br> </blockquote> </blockquote> <blockquote> <b>RegisterPerson.jar</b> <blockquote> client proxy JAR file containing the web service-specific JAX-RPC classes needed to access RegisterPerson.jws. This file was obtained from the <b>Java Proxy</b> link on the Overview page of Test View for RegisterPerson.jws. A Java client requires both the web service-specific JAR file and the generic <b>webserviceclient.jar</b> file that is available from Test View by clicking the <b>Proxy Support Jar</b> link.<br> </blockquote> </blockquote> <blockquote> <b>run.bat/run.sh</b> <blockquote> run scripts for the client for Windows and Linux/Unix, respectively. A run target in build.xml won't work because ant steals stdin. These scripts may require minor modification for your environment.<br> </blockquote> </blockquote> <h2>Compiling and Running RegisterClient.java</h2> <p>The following instructions assume that the WL_HOME and PATH environment variables are set correctly. See the <a href="#Environment">Environment</a> section above.</p> <ol> <li>Make sure the Workshop Example Server is running.</li> <li>In a cmd shell, cd to: <ul> <li>Linux/Unix: <tt>$WL_HOME/samples/workshop/SamplesApp/ProxyClient/register</tt></li> <li>Windows: <tt>%WL_HOME%\samples\workshop\SamplesApp\ProxyClient\register</tt></li> </ul> </li> <li>Type <b><tt>ant</tt></b> to compile the Java client.</li> <li>Type <b><tt>run</tt></b> to run the RegisterClient Java client. <li>Enter menu item numbers to perform the indicated actions. Each menu item causes invocation of a different web service operation.</li> </ol> </body> </html>