4 Upgrading WebLogic Web Services

Learn the procedures for upgrading WebLogic and RESTful web services from Oracle WebLogic Server 10.x to 14c..

This chapter includes the following sections:

Note:

The WebLogic web services (JAX-WS or JAX-RPC) 10.3.x will continue to run without any changes on WebLogic Server 14c, as the associated web services run time is still supported in this release, although they are deprecated and will be removed from the product in future releases. For this reason, Oracle highly recommends that you follow the instructions in this chapter to upgrade your 10.3.x web services to 14c.

The JAX-RPC API has been deprecated in 12.2.x and will be removed in a future release. Oracle does not recommend upgrading to the JAX-RPC stack.

Upgrading a 10.3.x RESTful Web Service (JAX-RS) to 14c

In 10.3.x, a set of pre-built shared libraries were delivered with WebLogic Server to support Jersey 1.9 and 1.1.5.1 Java API for RESTful Web Services (JAX-RS) Reference Implementations (RIs). In 14c, WebLogic Server supports Jersey 2.29 (JAX-RS 2.1 RI) by default.To use the pre-built shared libraries of 10.3.x, you needed to register them with the WebLogic Server instance, and modify the web.xml and weblogic.xml deployment descriptors to use the Jersey servlet and reference the shared libraries, respectively.

In 14c, as WebLogic Server supports Jersey 2.29 (JAX-RS 2.1 RI) by default, registration as a shared library with WebLogic Server is no longer required.

To use the Jersey 2.29 (JAX-RS 2.1 RI), you need to modify your 10.3.x RESTful Web service applications as follows:

  1. Update your application deployment descriptors to reference the Jersey 2.x container. See Servlet-based Deployment in Jersey 2.29 User Guide.

    Note:

    For backward compatibility, references to com.sun.jersey.spi.container.servlet.ServletContainer, as shown in the following example, continues to work. However, Oracle recommends that you update your application deployment descriptors to reference the Jersey 2.x container instead.

    For example, replace com.sun.jersey.spi.container.servlet.ServletContainer with org.glassfish.jersey.servlet.ServletContainer in the following <web-app> content:

    <web-app>
        <servlet>
            <display-name>My Jersey Application</display-name>
            <servlet-name>MyJerseyApp</servlet-name>
            <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
            <init-param>
                <param-name>javax.ws.rs.Application</param-name>
                <param-value>myPackage.myJerseyApplication</param-value>
            </init-param>
        </servlet>
        <servlet-mapping>
            <servlet-name>MyJerseyApp</servlet-name>
            <url-pattern>/*</url-pattern>
        </servlet-mapping>
    </web-app>
    

    For more advanced configuration options, see Jersey 2.29 User Guide.

  2. If applicable, update all applications that use Jersey 1.x server APIs to use the corresponding standard JAX-RS 2.1 or Jersey 2.x APIs instead. Support for the Jersey 1.x (JAX-RS 1.1 RI) server APIs has been removed in this release and applications that reference them will not work.
  3. Update your clients to use the javax.ws.rs.client API, as described in Developing RESTful Web Service Clients in Developing and Securing RESTful Web Services for Oracle WebLogic Server.

    Note:

    Support for the Jersey 1.18 client packages, including the com.sun.jerseypackage, its nested packages, and the weblogic.jaxrs.api.client package, is deprecated in this release of WebLogic Server, but are maintained for backward compatibility. However, many Fusion Middleware components, such as Oracle Web Services Manager, have been migrated to the standard JAX-RS 2.0 client API and are not compatible with the Jersey 1.x JAX-RS client APIs. Therefore, Oracle strongly recommends that you update your RESTful client applications as soon as possible to use the standard JAX-RS 2.0 API.

    The Jersey 1.x JAX-RS RI client APIs are not compatible with Jersey 2.x (JAX-RS 2.0 RI).

Upgrading a 10.x WebLogic Web Service (JAX-WS) to 14c

No steps are required to upgrade a 10.x WebLogic web service to 14c. You can redeploy the JAX-WS Web service to WebLogic Server 14c without making any changes or recompiling.

Upgrading a WebLogic JAX-RPC Web Service to the WebLogic JAX-WS Stack

The WebLogic JAX-WS run time is based on the JAX-WS (The Java API for XML-Based Web Services) 2.2 specification and the Web Services for Java EE v1.3 (JSR 109) specifications. Starting with JAX-WS 2.0, the JAX-WS technology has replaced JAX-RPC in the Java Platform and in WebLogic Server. JAX-RPC Web Services in WebLogic applications should be upgraded to JAX-WS.

Note:

The JAX-RPC API has been deprecated in 12.2.x and will be removed in a future release. Oracle does not recommend upgrading to the JAX-RPC stack.

This section summarizes how to upgrade a WebLogic JAX-RPC Web service to use the WebLogic JAX-WS stack.

Upgrading your WebLogic Server JAX-RPC Web service includes the following high-level tasks:

  • Upgrade any Web service EJBs from 2.x to 3.x.

    JAX-WS supports EJB 3.0 and 3.x. It does not support EJB 2.x.

  • Upgrade your JWS, mapping any proprietary JAX-RPC features to similar JAX-WS features.

    Note that there is not a one-to-one correspondence between WebLogic JAX-RPC Web service features and JAX-WS 12.x features.

  • Update the Ant build script that builds the Web service to change the value of the type attribute on the jws, wsdlc, and clientgen tasks to be "JAXWS" (for example, type="JAXWS").

  • Generate new JAX-WS clients using the JAX-WS clientgen Ant task.

JAX-WS Upgrade Considerations

When upgrading to JAX-WS, you should consider the following:

  • The JAX-WS specification supports the document-literal and rpc-literal styles, but not rpc-encoded.

  • SOAP Arrays are not supported by JAX-WS.

See Developing JAX-WS Web Services for Oracle WebLogic Server.