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 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, always ensure that it remains up to date with the actual Web Service. In other words, if you change your Web Service, 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:
- Un-JAR the WebLogic Web Services EAR file and then the WAR file that contains the web-services.xml file.
- 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.
- 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>- Re-JAR the Web Services WAR and EAR files.
- 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.