# Declaring Compliance with a WSDL File

A WSDL (Web Services Definition Language) file is a public contract that a web service publishes so that a client knows how to call it. A Web Service control typically declares explicitly that it complies with the public contract expressed in a WSDL file. This compliance is declared with the @jc:wsdl annotation. The @jc:wsdl annotation's file attribute names the WSDL file with which the Web Service control complies.

The @jc:wsdl annotation may refer to a file that is inline within the Web Service control. The WSDL contents are specified as the value of a @common:define annotation. The @jc:wsdl annotation's file attribute then refers to #Name instead of an actual file name, where Name is the value of the @common:define annotation's name attribute. The following code sample illustrate this arrangement:

    import com.bea.control.ServiceControl;
    /**
     * @jc:location http-url="creditreport/IRS.jws" jms-url="creditreport/IRS.jws"
     * @jc:wsdl file="#IRSWsdl"
     */
    public interface IRSControl extends ServiceControl
    {
        ...
    }
    /**
     @common:define name="IRSWsdl" value::
          <?xml version=1.0 encoding=utf-8?>
          <definitions ...>
            ...remainder of WSDL here...
          </definitions>
      ::
     */

If a Web Service control has an associated @jc:wsdl annotation, the methods in the Web Service control's interface must be capable of producing messages that comply with the operations defined in the WSDL file. Note, however, that this does not guarantee that the signature of a method in a Web Service control is identical to the signature of a method in the JWS file from which it was generated, in the case of an autogenerated Web Service control. The Web Service control must only adhere to the public contract defined by the WSDL, meaning that it can produce WSDL-compliant messages; because the WSDL makes no requirements about implementation, the Web Service control may construct those messages differently than the web service does.

To learn more about the @jc:wsdl annotation, see @jws:wsdl annotation, which is used within the web service on which an autogenerated Web Service control is based.

Related Topics

@jws:wsdl Annotation

JCX Files: Implementing Controls

WSDL Files: Web Service Descriptions

@common:define Annotation