How Do I: Use a WebLogic Server Web Service?

WebLogic Server provides a way to create web services outside of WebLogic Workshop, by using the servicegen facility. You can use a WebLogic Server web service within WebLogic Workshop in exactly the same way you use a web service built with any tool: with a Web Service control. A Web Service control can be created from the WSDL file for the target web service.

Note: WebLogic Server web services are typically derived directly from EJBs (Enterprise Java Beans). If the underlying EJB of the target web service is deployed locally, it is much more efficient to use an EJB Control to access the EJB than a Web Service control associated with the EJB's WebLogic Server web service. To learn more about EJB Controls, see EJB Control.

In order to create a Web Service control for a non-WebLogic Workshop web service, you must first obtain the target web service's Web Service Description Language (WSDL) file. The WSDL file can typically be obtained by accessing the web service's URL with ?WSDL appended.

To Build a Web Service Control for a WebLogic Server Web Service

  1. In a web browser, access the web service from the browser using the normal URL with ?WSDL appended to the end.
  2. For instance, if the service were at the URL http://host/TraderService, you would enter the following URL:
    http://host/TraderService?WSDL
    
  3. Save the WSDL you receive to a WebLogic Workshop project. Note that some browsers will save the file with HTML tags at the top and bottom that must be removed in a text editor.
  4. In WebLogic Workshop, browse to the project and directory to which you saved the WSDL file.
  5. Right-click on the WSDL file and select Generate JCX from WSDL. The resulting JCX file is a Web Service control that you may use from any web service in the project.

    Note: WSDL files generated by WebLogic Server 6.1 use an earlier version of XML Schema which may make them incompatible with WebLogic Workshop 8.1. To learn how to modify a WebLogic Server 6.1 WSDL file so that it may be used by WebLogic Workshop, see How Do I: Create a Web Service control from a WSDL File Generated by WebLogic Server 6.1?.

Related Topics

Web Service Control

Working with Built-In Controls