Skip navigation.
Downloads | Product Documentation | Support

Programming WebLogic Web Services

# 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
- Creating a Custom WebLogic Web Service Home Page
- Configuring Basic Microsoft MIME Types in the Generated web.xml

# 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 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 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.

# Configuring Basic Microsoft MIME Types in the Generated web.xml

The generated `web.xml` file in the generated WAR file of your Web Service does not contain information about how to map the file extensions of basic Microsoft applications (such as Microsoft Word and Excel) to MIME types. If you want your Web Application to understand these applications, follow these steps:

1. Update the `web.xml` file of the Web application, adding a `<mime-mapping>` element to map the extensions of Microsoft Word applications to their appropriate MIME type.

For example:

>     <mime-mapping>
>         <extension>xls</extension>
>         <mime-type>application/vnd.ms-excel</mime-type>
>         <extension>mdb</extension>
>         <mime-type>application/vnd.ms-access</mime-type>
>         <extension>mpp</extension>
>         <mime-type>application/vnd.ms-project</mime-type>
>         <extension>doc</extension>
>         <mime-type>application/msword</mime-type>
>         <extension>xls</extension>
>         <mime-type>application/ms-excel</mime-type>
>         <extension>ppt</extension>
>         <mime-type>application/ms-powerpoint</mime-type>
>     </mime-mapping>

2. Re-JAR the Web Services WAR and EAR files.