A WSDL document is written in XML and describes a Web service. In addition to specifying the location of the Web service, a WSDL description also specifies the methods provided by the Web service, and the messages, datatypes, and communication protocols used by the Web service with the following tags:
<service> – defines the name of the Web service. For example, a Web service called ExecuteStoredProcService could be named as follows:
<wsdl:service name="ExecuteStoredProcService"> <wsdl:port binding="impl:aseSoapBinding" name="ase"> <wsdlsoap:address location="http://myserver:8181/services/ase"/> </wsdl:port> </wsdl:service>
A WSDL document may contain one or more <service> tags. In the case of the ASE Web Services Engine, there is only one service, which is named “ase.”
<binding> – defines the communication protocols used. The following example uses the SOAP protocol:
<wsdl:binding name="aseSoapBinding" type="impl:ExecuteStoredProc"> ... </wsdl:binding>
WSDL also supports use of HTTP and MIME protocols.
<port> – specifies the Web service address. For example:
<wsdl:port binding="impl:aseSoapBinding" name="ase"> <wsdlsoap:address location="http://myserver:8181/services/ase"/> </wsdl:port>
The <port> tag has attributes for name and binding.
<message> – defines the messages used. For example:
<wsdl:message name="executeRequest"> <wsdl:part name="service" type="xsd:string"/> <wsdl:part name="userName" type="xsd:string"/> <wsdl:part name="password" type="xsd:string"/> <wsdl:part name="sqlxOptions" type="xsd:string"/> <wsdl:part name="sql" type="xsd:string"/> </wsdl:message>
This is a request message for a method called executeRequest. The <part> tags correspond to parameter values for the method call in a request message and to return values in a response.
<operation> – associates a message with a Web method request or response. For example:
<wsdl:operation name="execute" parameterOrder="service userName password sqlxOptions sql"> <wsdl:input message="impl:executeRequest" name="executeRequest"/> <wsdl:output message="impl:executeResponse" name="executeResponse"/> </wsdl:operation>
<portType> – defines the methods provided. The <operation> tag is a child element of <portType>. For example:
<wsdl:portType name="ExecuteStoredProc"> <wsdl:operation name="execute" parameterOrder="aseServerName asePortNumber .... </wsdl:operation> </wsdl:portType>
<types> – defines the datatypes used. WSDL uses XML schema syntax to define datatypes.
WSDL is usually automatically generated by the ASE Web Services Engine and can be viewed in a Web browser at the following location:
http://myserver:producer_port/services/ase?wsdl
where:
myserver – is the name of the host on which the ASE Web Services Engine is running,
producer_port – is the port number.