How Do I: Publish A WSDL File For My Web Service?

At any time in the development process, the Web Service Description Language (WSDL) file describing your web service is available from WebLogic Server. WSDL is a standard XML document type controlled by the World Wide Web Consortium (W3C, see www.w3.org for more information).

WSDL files describe all the methods a web service exposes (in the form of XML messages it can accept and send), as well as the protocols over which the web service is available. The WSDL file provides all the information a client application needs to use the web service.

There are two ways to obtain the WSDL file corresponding to a JWS file. One is through a URL to a page that others (including clients) can also use to get information about your service, including its WSDL file. The other is through a command in WebLogic Workshop that you can use when you merely wish to generate a WSDL for your own use. For more information about the second, see How Do I: Generate a WSDL File?

To Generate a WSDL File from a JWS File in WebLogic Workshop

1. In the Project tree, browse to the JWS file for which you would like to generate a WSDL file.

2. Right-click on the JWS file in the Project tree and select Generate WSDL from JWS.

If the name of the JWS file is MyService.jws, a file with the name MyServiceContract.wsdl will be created in the same directory. By default, the WSDL file is linked to the JWS file from which it was generated, meaning it will be regenerated whenever the JWS file is changed.

To Obtain a WSDL File from WebLogic Server

The WSDL file for a web service is available to any potential client that can reach the web service's URL. To obtain a web service's WSDL file from WebLogic Server:

1. In a browser, browse to the URL of the web service with ?WSDL appended. For example

   http://myServer:7001/MyProject/MyWebService.jws?WSDL

2. Use your browser's File->SaveAs function to save the WSDL file to your local machine. Note that some browsers will include HTML tags at the top and bottom of the saved file. You must remove these tags to produce a valid WSDL file.

Related Topics

Test View: Overview Tab