Content Server - Using WSDL Generator and SOAP PDF

Using WSDL Files > Understanding WSDL Files > WSDL File Structure


WSDL File Structure

WSDL files are formally structured with elements that contain a description of the data to be passed to the web service. This enables both the sending application and the receiving application to interpret the data being exchanged.

WSDL elements contain a description of the operation to perform on the data and a binding to a protocol or transport. This permits the receiving application to both process the data and interpret how to respond or return data. Additional sub-elements may be contained within each WSDL element.

The WSDL file structure includes these major elements:

Note: The code fragments in this section are from the DocInfo.wsdl file provided with the WSDL Generator component. See Sample WSDL File for a complete WSDL file.

Data Type

The Data Type <types> defines the complex types and associated elements. Web services supports both simple data types (such as string, integer, or boolean) and complex data types. A complex type is a structured XML document that contains a number of simple types or an array of sub-elements.

The following fragment for the ContentInfo set defines the Name, Title, Author, and Group elements and specifies that they are strings.

<s:complexType name="ContentInfo">

<s:sequence>

<s:element minOccurs="0" maxOccurs="1" name="dDocName" type="s:string"/>

<s:element minOccurs="0" maxOccurs="1" name="dDocTitle" type="s:string"/>

<s:element minOccurs="0" maxOccurs="1" name="dDocType" type="s:string"/>

<s:element minOccurs="0" maxOccurs="1" name="dDocAuthor" type="s:string"/>

<s:element minOccurs="0" maxOccurs="1" name="dSecurityGroup" type="s:string"/>

</s:sequence>

</s:complexType>

Message

The Message <message> defines the data as arguments to be mapped to a method invocation.

<message name="DocInfoByIDSoapIn">

<part name="parameters" element="s0:DocInfoByID" />

</message>

<message name="DocInfoByIDSoapOut">

<part name="parameters" element="s0:DocInfobyIDResponse" />

</message>

Port Type

The Port Type <portType> defines a collection of operations for a binding. The DocInfo.wsdl file provides the DocInfoSoap and the DocInfo operation name (method name) with input/output information for processing the message.

<portType name="DocInfoSoap">

<operation name="DocInfoByID">

<input message="s0:DocInfoByIDSoapIn" />

<output message="s0:DocInfoByIDSoapOut" />

</operation>

</portType>

Note: While a port type is a collection of operations (like classes in Java), WSDL is an independent data abstraction that provides more functionality than simply mapping to .NET, EJB, or CORBA objects.

Binding

The binding <binding> defines the actual protocol and data formats for the operations and messages for the particular port type.

<binding name="DocInfoSoap" type="s0:DocInfoSoap">

<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />

<operation name="DocInfoByID">

<soap:operation soapAction="http://wwww.oracle.com/Soap/DocInfo/" style="document" />

<input>

<soap:body use="literal" />

</input>

<output>

<soap:body use="literal" />

</output>

</operation>

</binding>

Service and Port

The service <service> maps the binding to the port. The port is the combination of a binding and the network address for the communication exchange. The port is used to expose a set of port types (operations) on the defined transport.

<service name="DocInfo">

<port name="DocInfoSoap" binding="s0:DocInfoSoap">

<soap:address location="HTTP://testserver/stellent/idcplg" />

</port>

</service>

Tech Tip: You can add &IsSoap=1 to the URL of a Content Server browser window to view the underlying SOAP code for that page.


Copyright © 1996, 2007, Oracle. All rights reserved.