|
WebLogic Server 7.0 Code Examples, BEA Systems, Inc. | |||||
See:
Description
| Class Summary | |
| A | |
| B | |
| Client | |
This example shows how to create a WebLogic Web service based on two custom Java class backend components.
The first Java class, A, defines a single method echoInt
that takes as input an integer and simply returns the same integer. The
second Java class, B, defines a single method echoString
that takes as input a String and simply returns the same String.
When the two Java classes are converted into a Web service, the echoInt
and echoString methods become the public operations specified in
the WSDL of the Web service. Even though the two methods originate from two
different backend components, they are treated the same in the WSDL and client
applications invoke them similarly.
This example does not use servicegen to generate the
web-services.xml file, but rather shows an already created deployment
descriptor that defines the Java class backend components and the two public
operations.
The build.xml file compiles, assembles, packages, deploys, and
runs the example.
Client.java is a dynamic client application that does not
use the WebLogic-generated client JAR file to invoke the Web service. Rather,
the client application dynamically discovers the public operations, using the
javax.xml.rpc.Call JAX-RPC API, based on the URL of the Web service.
| Additional Resources for examples.webservices.multicomponent | |
| web-services.xml | The Web services deployment descriptor file that describes the two Java class backend components that make up the Web service and its public operations. |
| application.xml | The application deployment descriptor. |
| build.xml | The Java Ant build script that compiles the Java classes, creates a WAR file that contains the web-services.xml file, then packages all these components into a deployable EAR file. The build file also compiles the dynamic client application. |
The following sections describe how to build and run the example.
Before you run this example, you need:
prompt> ant
prompt> ant run
http://localhost:port/multicomponent/Multi
where
From the Web Service Home Page you can view the generated WSDL, download a client JAR file, and test the Web service to make sure it's working correctly.
|
Documentation is available at http://e-docs.bea.com/wls/docs70 |
|||||