Skip navigation.
Downloads | Product Documentation | Support

Programming WebLogic Web Services

# Upgrading WebLogic Web Services

The following sections describe how to upgrade WebLogic Web Services to 8.1:

- Overview of Upgrading WebLogic Web Services
- Upgrading a 7.0 WebLogic Web Service to 8.1
- Upgrading a 6.1 WebLogic Web Service to 8.1

# Overview of Upgrading WebLogic Web Services

Because of changes in the Web Service runtime system between Versions 6.1, 7.0, and 8.1 of WebLogic Server, you must upgrade Web Services created in version 6.1 and 7.0 to run on Version 8.1.

# Upgrading a 7.0 WebLogic Web Service to 8.1

To upgrade a 7.0 WebLogic Web Service to Version 8.1:

1. Set your 8.1 environment.

On Windows NT, execute the `setEnv.cmd` command, located in your domain directory. The default location of WebLogic Server domains is BEA_HOME`\user_projects\domains\`domainName, where `BEA_HOME` is the top-level installation directory of the BEA products and `domainName` is the name of your domain.

On UNIX, execute the `setEnv.sh` command, located in your domain directory. The default location of WebLogic Server domains is BEA_HOME`/user_projects/domains/`domainName, where `BEA_HOME` is the top-level installation directory of the BEA products and `domainName` is the name of your domain.

2. Change to the staging directory that contains the components of your Version 7.0 Web Service, such as the EJB JAR file and the `build.xml` file that contains the call to the `servicegen` Ant task.
3. Execute the `servicegen` Ant task specified in the `build.xml` file by typing `ant` in the staging directory:

>     prompt> ant

The Ant task generates the 8.1 Web Services EAR file in the staging directory which can then deploy on WebLogic Server.

# Upgrading a 6.1 WebLogic Web Service to 8.1

You upgrade a 6.1 Web Service manually, by rewriting the `build.xml` file you used to create the 6.1 Web Service to now call the `servicegen` Ant task rather than the `wsgen` Ant task. You cannot deploy a 6.1 Web Service on a 8.1 WebLogic Server instance.

Warning: The `wsgen` Ant task was deprecated in Version 7.0 of WebLogic Server, and is not supported in Version 8.1.

The WebLogic Web Services client API included in version 6.1 of WebLogic Server has been removed and you cannot use it to invoke 8.1 Web Services. Version 8.1 includes a new client API, based on the Java API for XML based RPC (JAX-RPC). You must rewrite client applications that used the 6.1 Web Services client API to now use the JAX-RPC APIs. For details, see Invoking Web Services from Client Applications and WebLogic Server.

To upgrade a 6.1 WebLogic Web Service to 8.1:

1. Convert the `build.xml` Ant build file used to assemble 6.1 Web Services with the `wsgen` Ant task to the 8.1 version that calls the `servicegen` Ant task.

For details see Converting a 6.1 build.xml file to 8.1.

2. Un-jar the 6.1 Web Services EAR file and extract the EJB JAR file that contains the stateless session EJBs (for 6.1 RPC-style Web Services) or message-driven beans (for 6.1 message-style Web Services), along with any supporting class files.
3. If your 6.1 Web Service was RPC-style, seeAssembling WebLogic Web Services Using the servicegen Ant Task for instructions on using the `servicegen` Ant task. If your 6.1 Web Service was message-style, see Assembling JMS-Implemented WebLogic Web Services Using servicegen.
4. In your client application, update the URL you use to access the Web Service or the WSDL of the Web Service from that used in 6.1 to 8.1. For details, see Updating the URL Used to Access the Web Service.

## Converting a 6.1 build.xml file to 8.1

The main difference between the 6.1 and 8.1 `build.xml` files used to assemble a Web Service is the Ant task: in 6.1 the task was called `wsgen` and in 8.1 it is called `servicegen`. The `servicegen` Ant task uses many of the same elements and attributes of `wsgen`, although some do not apply anymore. The `servicegen` Ant task also includes additional configuration options. The table at the end of this section describes the mapping between the elements and attributes of the two Ant tasks.

The following `build.xml` excerpt is from the 6.1 RPC-style Web Services example:

>     <project name="myProject" default="wsgen">
>             <target name="wsgen">
>                <wsgen destpath="weather.ear"
>                       context="/weather">
>                     <rpcservices path="weather.jar">
>                        <rpcservice bean="statelessSession"
>                                    uri="/weatheruri"/>
>                        </rpcservices>
>                </wsgen>
>             </target>
>     </project>

The following example shows an equivalent 8.1 `build.xml` file:

>     <project name="myProject" default="servicegen">
>         <target name="servicegen">
>            <servicegen
>                destEar="weather.ear"
>                contextURI="weather" >
>                <service
>                    ejbJar="weather.jar"
>                    serviceURI="/weatheruri"
>                    includeEJBs="statelessSession" >
>                </service>
>            </servicegen>
>         </target>
>     </project>

For detailed information on the WebLogic Web Service Ant tasks, see Web Service Ant Tasks and Command-Line Utilities.

The following table maps the 6.1 `wsgen` elements and attributes to their equivalent 8.1 `servicegen` elements and attributes.

Table 21-1 6.1 to 8.1 wsgen Ant Task Mapping

6.1 wsgen Element | Attribute | Equivalent 8.1 servicegen element | Attribute
--- | --- | --- | ---
wsgen | basepath | No equivalent. | No equivalent
destpath | servicegen | destEar
context | servicegen | contextURI
protocol | servicegen.service | protocol
host | No equivalent. | No equivalent
port | No equivalent. | No equivalent
webapp | servicegen | warName
classpath | servicegen | classpath
rpcservices | module | No equivalent. | No equivalent
path | servicegen.service | ejbJar
rpcservice | bean | servicegen.service | includeEJBS, excludeEJBs
uri | servicegen.service | serviceURI
messageservices | N/A | No equivalent. | No equivalent
messageservice | name | No equivalent. | No equivalent.
destination | servicegen.service | JMSDestination
destinationtype | servicegen.service | JMSDestinationType
action | servicegen.service | JMSAction
connectionfactory | servicegen.service | JMSConnectionFactory
uri | servicegen.service | serviceURI
clientjar | path | servicegen.service.client | clientJarName

## Updating the URL Used to Access the Web Service

The default URL used by client applications to access a WebLogic Web Service and its WSDL has changed between versions 6.1 and 8.1 of WebLogic Server.

In Version 6.1, the default URL was:

>     [protocol]://[host]:[port]/[context]/[WSname]/[WSname].wsdl

as described in URLs to Invoke WebLogic Web Services and Get the WSDL.

For example, the URL to invoke a 6.1 Web Service built with the `build.xml` file shown in Converting a 6.1 build.xml file to 8.1, is:

>     http://host:port/weather/statelessSession.WeatherHome/statelessSession.WeatherHome.wsdl

In 8.1, the default URL is:

>     [protocol]://[host]:[port]/[contextURI]/[serviceURI]?WSDL

as described in WebLogic Web Services Home Page and WSDL URLs.

For example, the URL to invoke the equivalent 8.1 Web Service after converting the 6.1 `build.xml` file shown in Converting a 6.1 build.xml file to 8.1 and running `wsgen` is:

>     http://host:port/weather/weatheruri?WSDL