Programming WebLogic Web Services

 Previous Next Contents View as PDF  

Customizing WebLogic Web Services

The following sections describe how to customize your WebLogic Web service by updating the Web application deployment descriptor files of your Web service WAR file:

 


Publishing a Static WSDL File

By default, WebLogic Server dynamically generates the WSDL of a WebLogic Web service, based on the contents of its web-services.xml deployment descriptor file. See The WebLogic Web Services Home Page and WSDL URLs for details on getting the URL of the dynamically generated WSDL.

You can, however, include a static version of the WSDL file in the Web services EAR file and publish its URL as the public description of your Web service. One reason for publishing a static WSDL is to be able to add more custom documentation than what the dynamically generated WSDL contains.

Warning: If you publish a static WSDL as the public description of your Web service, you must always ensure that it remains up to date with the actual Web service. In other words, if you change your Web service, you must also manually change the static WSDL to reflect the changes you made to your Web service. One advantage of using the dynamic WebLogic-generated WSDL is that it is always up to date.

To include a static WSDL file in your Web services EAR file and publish it, rather than the dynamically generated WSDL, to the Web, follow these steps:

  1. Un-JAR the WebLogic Web services EAR file and then the WAR file that contains the web-services.xml file.

  2. Put the static WSDL file in a directory of the exploded Web application. This procedure assumes you put the file at the top-level directory.

  3. Update the web.xml file of the Web application, adding a <mime-mapping> element to map the extension of your WSDL file to an XML mime type.

    For example, if the name of your static WSDL file is myService.wsdl, the corresponding entry in the web.xml file is as follows:

            <mime-mapping>
    <extension>wsdl</extension>
    <mime-type>text/xml</mime-type>
    </mime-mapping>

  4. Re-JAR the Web services WAR and EAR files.

  5. Invoke the static WSDL file using the standard URL to invoke a static file in a Web application.

    For example, use the following URL to invoke the myService.wsdl file in a Web application that has a context root of web_services:

    http://host:port/web_services/myService.wsdl

 


Creating a Custom WebLogic Web Service Home Page

Every WebLogic Web service has a default Home Page that contains links to view the WSDL of the Web service, test the service, download the client JAR file, and view the SOAP requests and responses of a client application invoking the Web service. See The WebLogic Web Services Home Page and WSDL URLs for details.

WebLogic Server dynamically generates the Web services Home page and thus it cannot be customized. If you want to create your own custom Home Page, add an HTML or JSP file to the Web services WAR file. For more information on creating JSPs, see Programming WebLogic JSP.

 

Back to Top Previous Next