# WSDL Files: Web Service Descriptions

Files with the WSDL extension contain web service interfaces expressed in the Web Service Description Language (WSDL). WSDL is a standard XML document type specified by the World Wide Web Consortium (W3C, see www.w3.org for more information).

WSDL files are used to communicate interface information between web service producers and consumers. A WSDL description allows a client to utilize a web service’s capabilities without knowledge of the implementation details of the web service.

## Contents of a WSDL File

A WSDL file contains all of the information necessary for a client to invoke the methods of a web service:

- The data types used as method parameters or return values
- The individual methods names and signatures (WSDL refers to methods as operations)
- The protocols and message formats allowed for each method
- The URLs used to access the web service

## Imported WSDL Files

When you want to use an external web service from within WebLogic Workshop, you should first obtain the WSDL file for the service you want to use. For public web services, the WSDL file will typically be available on the web site of the organization that publishes the web service. For private web services, contact the organization that supports the web service to obtain the WSDL file.

WSDL files can also be found through both public and private UDDI registries. To learn more about UDDI, visit http://www.uddi.org.

Once you have the WSDL file, you may use WebLogic Workshop to create a Web Service control. The Web Service control may then be used from your application like any other WebLogic Workshop Java control.

Some web service tools produce WSDL files that do not contain an XML declaration. WebLogic Workshop requires that all XML files contain an XML declaration. The XML declaration is just the first line of an XML file of the following form:

> <?xml version="1.0" encoding="utf-8" ?>

If you receive a WSDL file that does not contain an XML declaration, you must add a declaration to the file using a text editor before you can use the WSDL file in WebLogic Workshop.

Note that the encoding attribute is not required. If an encoding attribute is not present, the default encoding is utf-8.

To learn more about producing a Web Service control file from a WSDL file, see Creating a Web Service Control from a WSDL File.

JCX Files: Extending Controls

If the web service you wish to use was built with WebLogic Workshop, you can create a Web Service control JCX file directly from the web service's JWS file.

Note: You should not use a Web Service control to invoke a web service that resides in the same application. Invoking a web service via a Web Service control means marshalling the method parameters into a SOAP message on the calling end and unmarshalling the SOAP message on the receiving end, then again for the method return value. This is very inefficient when the invocation is local. You would usually be tempted to invoke one web service from another if the called web service included business logic you want to access from the calling web service.

In general, you should place business logic in custom Java controls instead of in web services. This allows you to access the business logic from various contexts in the application (web services, other controls, page flows) without incurring the cost of data marshalling and unmarshalling. Web Service controls should only be used to invoke web services that are truly external to your application.

To learn more about Web Service controls, see Web Service Control.

## Generating WSDL Files

When you want to make your web service available to others, you do so by producing a WSDL file for your web service and making it available to your service's clients.

For more information on generating WSDL files, see How Do I: Generate a WSDL File?.

If your clients are web services built with WebLogic Workshop, they can use a Web Service control JCX file generated directly from your web service's JWS file.

Related Topics

JCX Files: Extending Controls

Applications and Projects

Web Service Control

W3C WSDL Specification