apache > ws.apache
WSRF
 

Composing a WSRF WSDL

Using the WSRF WSDL Template

Resources are exposed as WSRF WS-Resources using the Web Services Description Language (WSDL). The WSDL must conform to the conventions as described in the WSRF Specifications. To make it easier to write a WSRF WSDL, Apache WSRF provides a template WSDL that can be used as a starting point. The template saves a good deal of time and is less error-prone than writing a WSRF-compliant WSDL from scratch.

To use the template:

  1. Using a text or XML editor, open INSTALL_DIR/template/_TEMPLATE_.wsdl.
  2. Save the file with a new name (e.g., nameOfYourService.wsdl).
  3. Modify your WSDL based on the instructions in the template and the information below.
Warning
Do not modify the original template file.

Defining the WSRF PortType

A WSRF WSDL should contain only one portType. The portType aggregates operations from WSRF specification-defined portTypes and custom resource-specific operations. The specification-defined portTypes that are discussed below include:

  • WS-ResourceProperties (WSRF-RP) portTypes
  • WS-ResourceLifetime (WSRF-RL) portTypes

If you've copied the WSDL template file as described above, your WSDL file already contains a WSRF-compliant portType. You simply have to rename the portType (MyPortType) and the binding (MySoapHttpBinding) and uncomment the blocks corresponding to whichever optional portTypes you want your WS-Resource to support.

WS-ResourceProperties (WSRF-RP) PortTypes

PortType Operations Properties
GetResourceProperty GetResourceProperty
GetMultipleResourceProperties GetMultipleResourceProperties
SetResourceProperties SetResourceProperties
QueryResourceProperties QueryResourceProperties
Note
If your portType has an associated resource properties document, then the WSRF-RP specification REQUIRES that you implement the GetResourceProperty portType (i,e, the GetResourceProperty operation).

WS-ResourceLifetime (WSRF-RL) PortTypes

PortType Operations Properties
ImmediateResourceTermination Destroy
ScheduledResourceTermination SetTerminationTime CurrentTime,
TerminationTime
Note
In addition to operations, the ScheduledResourceTermination portType also includes two properties. If a WS-Resource implements this portType, it must also expose these properties.

If your WS-Resource exposes any resource properties, the PortType element must have a {http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.xsd}ResourceProperties attribute whose value is the QName of a resource properties document element defined in the types/schema section of the WSDL file.

Metadata Operations

The template contains two operations that are not defined by the WSRF specifications that can be used in your service to retrieve metadata about your services. The operations and messages are defined in the WS-Metadata Exchange specification defined by Microsoft and other industry contributors. For instructions on providing metadata about your service, see the Adding Service Metadata section.

Adding Custom Operations

Custom operations can be added to the WSRF portType. To do so, you will have to define message types, messages, and operations, as you would for any WSDL. It is recommended that, when defining your custom operations, you adhere to the rules defined by section 5 of the WS-I Basic Profile. This will ensure maximum interoperability for your WS-Resource.

Defining Resource Properties

Resource properties are defined in the types/schema section of the WSDL file. In addition to defining custom resource-specific properties, you may also need to add properties that are required by certain specification-defined portTypes. For example, the WSRF-RL ScheduledResourceTermination portType requires two properties (see above). Chapter 4 of the WSRF-RP specification explains how to define resource properties.

If you have copied the WSDL template file as described above, your WSDL file already contains a resource properties document definition. If your WS-Resource implements the WSRF-RL ScheduledResourceTermination portType, simply uncomment the xsd element references, which correspond to the two ScheduledResourceTermination properties. If would like your WS-Resource to allow resource properties with arbitrary names (not generally recommended), uncomment the xsd any element.