Using a Java SOAP Client Example

Instead of using the IBM-supplied SOAP client written in C for CICS® (soapclnt.c), you can use a Java™ SOAP client.

The SOAP client GetQuote.java is supplied with the Apache SOAP distribution. This example is stored in the Apache AXIS directory axis-bin-1_4\axis-1_4\samples\stock\GetQuote.java, contained in the Apache SOAP package (see Step 1: Download and Install the Java SOAP Client Packages on the Client for details).

You can also find an IBM-modified version of GetQuote.java in the directory ...\<install-directory>\samples\soap\javasample, together with batch files to compile and run the program. The example is provided as part of the VSE Connector Client. See section Installing the VSE Connector Client for how to install the VSE Connector Client. The sample has been modified so that it calls the IBM-supplied getQuote SOAP service, as shown by the highlighted statement of Figure 1.
Figure 1. SOAP Client Calls the getQuote Service
…
Call     call    = (Call) service.createCall();
call.setTargetEndpointAddress( url );
call.setOperationName( new QName("urn:iessoapd:getquote", "getQuote") );
call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.IN );
call.setReturnType( XMLType.XSD_STRING );
Object ret = call.invoke( new Object[] {symbol} );
…

As you can see, the setup of the call is similar to the setup when a SOAP client runs on the z/VSE host (as shown in Figure 2). The Java client sample performs the same processing as the SOAP client sample (soapclnt) that runs on the z/VSE host.

You must change the run.bat file (contained in the directory ...\<install-directory>\samples\soap\javasample) so that the URL of the SOAP server and the requested symbol, are given to the program on the command line. For details, refer to Running the IBM-Supplied SOAP Sample.