bea.com | products | dev2dev | support | askBEA |
|
e-docs > WebLogic Server > Programming WebLogic Web Services > Upgrading WebLogic Web Services |
Programming WebLogic Web Services |
Upgrading WebLogic Web Services
The following sections describe how to upgrade WebLogic Web Services to 8.1:
Upgrading a 7.0 WebLogic Web Service to 8.1
Due to changes in the Web Service runtime system between Versions 7.0 and 8.1 of WebLogic Server, you must upgrade Web Services created in version 7.0 to run on Version 8.1, as described in the following procedure:
On Windows NT, execute the setEnv.cmd command, located in the directory WL_HOME\server\bin, where WL_HOME is the top-level directory of your 8.1 WebLogic Platform installation.
On UNIX, execute the setEnv.sh command, located in the directory WL_HOME/server/bin, where WL_HOME is the top-level directory of your 8.1 WebLogic Platform installation.
prompt> ant
Upgrading a 6.1 WebLogic Web Service to 8.1
Due to changes in the Web Service runtime system between Versions 6.1 and 8.1 of WebLogic Server, you must upgrade Web Services created in version 6.1 to run on version 8.1. This section describes the upgrade process.
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.
To upgrade a 6.1 WebLogic Web Service to 8.1, follow these steps:
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.
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
[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 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