Programming WebLogic Web Services
By default, a WebLogic Web Service uses SOAP 1.1 as the message format when a client application invokes one of its operations. You can, however, use SOAP 1.2 as the message format by updating the
web-services.xml file and specifying a particular attribute in
clientgen when you generate the client stubs.
Warning: BEA's SOAP 1.2 implementation is based on the W3C Working Draft specification (June 26, 2002). Because this specification is not yet a W3C Recommendation, BEA's current implementation is subject to change. BEA highly recommends that you use the SOAP 1.2 feature included in this version of WebLogic Server in a development environment only.
clientgenAnt task, when generating the Web-service specific client JAR file for the Web Service, creates a
Serviceimplementation that contains two
getPort()methods, one for SOAP 1.1 and another for SOAP 1.2.
The following procedure assumes that you are familiar with the
servicegen Ant task, and you want to update the Web Service to use SOAP 1.2 as the message format. For an example of using
servicegen, see Creating a WebLogic Web Service: A Simple Example.
Note: If you are not using
servicegen, you can update the
web-services.xml file of your WebLogic Web Service manually. For details, see Updating the web-services.xml File Manually.
For general details about the
servicegen Ant task, see Creating the Build File That Specifies the servicegen Ant Task.
Because the WSDL of the Web Service has been updated to include an additional port with a SOAP 1.2 binding, the
clientgen Ant task automatically creates new stubs that contains these SOAP 1.2-specific
For details, see Generating the Client JAR File by Running the clientgen Ant Task.
See Invoking a Web Service Using SOAP 1.2 for details about writing a Java client application that invokes your Web Service.
web-services.xml file is located in the
WEB-INF directory of the Web application of the Web Services EAR file. See The Web Service EAR File Package for more information on locating the file.
useSOAP12="True"attribute to the
<web-service>element that describes your Web Service. For example:
When writing your client application to invoke the SOAP 1.2-enabled WebLogic Web Service, you first use the
clientgen Ant task to generate the Web Service-specific client JAR file that contains the generated stubs, as usual. The
clientgen Ant task in this case generates a JAX-RPC
Service implementation that contains two
getPort() methods: the standard one for SOAP 1.1, called
Port(), and a second one for SOAP 1.2, called
ServiceName refers to the name of your Web Service. These two
getPort() methods correspond to the two port definitions in the generated WSDL of the Web Service, as described in Overview of Using SOAP 1.2.
The following example of a simple client application shows how to invoke the
helloWorld operation of the
MyService Web Service using both SOAP 1.1 (via the
getMyservicePort() method) and SOAP 1.2 (via the