WebLogic Server 7.0 Code Examples, BEA Systems, Inc.

Package examples.webservices.client.static_out

This example shows how to use the WebLogic-generated JAX-RPC client Stubs to quickly and easily create a static client application that invokes a non-WebLogic Web service.

Package examples.webservices.client.static_out Description

This example shows how to use the WebLogic-generated JAX-RPC client Stubs to quickly and easily create a static client application that invokes a non-WebLogic Web service whose WSDL is publised at the following URL:
http://soap.4s4c.com/ilab/soap.asp?WSDL

The build.xml file calls the clientgen Ant task, specifying the WSDL of the Web service with the wsdl attribute. The Ant task creates a directory called websvc which contains the client Stub classes used by the Main.java client program to invoke the Web service.

The Main client application shows how to use the methods of the Web service to manipulate stuctures and arrays of simple data types. It also shows how to use the javax.xml.rpc.holders.* classes.

Additional Resources for examples.webservices.client.static_out
build.xml The Java Ant build script that creates the client Stub classes used to invoke the methods of a non-Weblogic Web service.
Main.java The client application that invokes the Web service.

 

The following sections describe how to build and run the example.

  1. Prerequisites
  2. Build the Example
  3. Run the Example
  4. Check the Output

 

Prerequisites

Before you run this example, you need:

 

Build the Example

To build the example, follow these steps:
  1. Set up your development shell as described in Quick Start.

  2. Change to the SAMPLES_HOME\server\src\examples\webservices\client\static_out directory, where SAMPLES_HOME refers to the examples WebLogic Server domain directory.

  3. Assemble and compile the example by executing the Java ant utility at the command line:
    prompt> ant

 

Run the Example

In your development shell, run the Main Java application using the following command:
prompt> ant run 

NOTE: You do not need to start WebLogic Server because the application invokes a Web service from a different vendor rather than one running on WebLogic Server.

 

Check the Output

If the example executes successfully, you will see the following message in the command window from which you ran the example:
Buildfile: build.xml

run:
     [java] This example shows how to create a static client application that invoke
s a non-WebLogic Web service.
     [java] The webservice used was: http://soap.4s4c.com/ilab/soap.asp?WSDL
     [java] This webservice shows how to invoke an operation that uses out parameter
s.  The set parameters are below:
     [java] outputString.value: hi there
     [java] outputInteger.value: 10
     [java] outputFloat.value: 10.1

BUILD SUCCESSFUL

 

See Also

Read more about:
Documentation is available at
http://e-docs.bea.com/wls/docs70/

Copyright © 2002 BEA Systems, Inc. All rights reserved.