e-docs > WebLogic Server > Programming WebLogic Web Services > Upgrading 6.1 WebLogic Web Services to 7.0 |
Programming WebLogic Web Services |
Upgrading 6.1 WebLogic Web Services to 7.0
The following sections describe how to upgrade a 6.1 WebLogic Web service to 7.0:
Overview of Upgrading 6.1 WebLogic Web Services
Due to changes in the Web service runtime system between Versions 6.1 and 7.0 of WebLogic Server, you should upgrade Web services created in version 6.1 to run on version 7.0. This chapter describes the upgrade process.
There are two ways to upgrade a 6.1 Web service:
For details, see "Upgrading 6.1 WebLogic Web Services to 7.0 Automatically" on page -2.
For details, see "Upgrading 6.1 WebLogic Web Services to 7.0 Manually" on page -4.
Note: You cannot deploy a 6.1 Web service on a 7.0 WebLogic Server instance.
The WebLogic Web services client API included in version 6.1 of WebLogic Server has been deprecated and you should not use it to invoke 7.0 Web services. Version 7.0 includes a new client API, based on the Java API for XML based RPC (JAX-RPC). You should 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.
For more detailed information on the differences between 6.1 and 7.0 Web services, see Overview of WebLogic Web Services.
Upgrading 6.1 WebLogic Web Services to 7.0 Automatically
Use the wsgen Ant task to automatically upgrade a Web service from 6.1 to 7.0. It takes as input the build.xml file you used to assemble the 6.1 Web service, and based on the values in this file, the task:
To upgrade a 6.1 WebLogic Web service to 7.0 automatically, follow these steps:
<taskdef name="wsgen" classname="weblogic.ant.taskdefs.ejb.WSGen"/>
On Windows NT, execute the setWLSEnv.cmd command, located in the directory WL_HOME\server\bin, where WL_HOME is the top-level directory of your WebLogic Platform installation.
On UNIX, execute the setWLSEnv.sh command, located in the directory WL_HOME/server/bin, where WL_HOME is the top-level directory of your WebLogic Platform installation.
prompt> ant
Upgrading 6.1 WebLogic Web Services to 7.0 Manually
To upgrade a 6.1 WebLogic Web service to 7.0 manually, follow these steps:
For details see "Converting a 6.1 build.xml file to 7.0" on page -4.
If your 6.1 Web service was message-style, you must assemble the 7.0 Web service manually. For detailed instructions, see Creating JMS-Implemented WebLogic Web Services.
Converting a 6.1 build.xml file to 7.0
The main difference between the 6.1 and 7.0 build.xml files used to assemble a Web service is the Ant task: in 6.1 the task was called wsgen and in 7.0 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.
Note: Although in 6.1 you were able to use the wsgen Ant task to assemble a message-style Web service, the servicegen Ant task does not have equivalent 7.0 functionality for JMS implemented backend components. Therefore, if you are upgrading a 6.1 message-style Web service, there is no need to convert the old build.xml file.
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 7.0 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 7.0 servicegen elements and attributes.
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 7.0 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 7.0" on page -4, is:
http://host:port/weather/statelessSession.WeatherHome/statelessSession.WeatherHome.wsdl
[protocol]://[host]:[port]/[contextURI]/[serviceURI]?WSDL
as described in The WebLogic Web Services Home Page and WSDL URLs.
For example, the URL to invoke the equivalent 7.0 Web service after converting the 6.1 build.xml file shown in "Converting a 6.1 build.xml file to 7.0" on page -4 and running wsgen is:
http://host:port/weather/weatheruri?WSDL