apache > ws.apache
Pubscribe
 

Composing a WSRF/WSN WSDL

Using the WSRF/WSN WSDL Template

Resources and notifications are exposed as WS-Resources using the Web Services Description Language (WSDL). The WSDL must conform to the conventions as described in the WSRF and WSN specifications. To make it easier to write a WSRF/WSN WSDL, Pubscribe 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/WSN-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/WSN PortType

A WSRF/WSN WSDL should contain only one portType. The portType aggregates operations from WSRF and WSN specification-defined portTypes and custom resource-specific operations. If you copied the WSDL template file as described above, your WSDL file already contains a WSRF/WSN-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.

Note
The WSRF portTypes - WS-ResourceProperties (WSRF-RP) and WS-ResourceLifetime (WSRF-RL)- and their associated operations are described in the Apache WSRF WSDL Documentation. The instructions include defining the resource properties document, custom properties, and custom operations.

WS-BaseNotification PortTypes

The WS-BaseNotification specification defines three portTypes:

  • NotificationProducer - This portType allows a resource to advertise notification topics and allows clients to subscribe to these topics. To implement this portType, uncomment the three NotificationProducer property references (wsnt:Topic, wsnt:FixedTopicSet, and wsnt:TopicExpressionDialects) within the types/schema section of the WSDL. Then, uncomment the two NotificationProducer operations (Subscribe and GetCurrentMessage) within both the portType and binding sections. See Notification Producer.
  • NotificationConsumer - This portType allows a resource to receive notification messages from a notification producer. To implement this portType, uncomment the Notify operation. See Notification Consumer.
  • SubscriptionManager - This portType defines message exchanges to manipulate (pause and resume) Subscription resources. An implementation of this portType is included in Pubscribe as a separate service and therefore does not have to be included in the WSRF/WSN WSDL for a resource. For more information on the Subscription Manager service, see Using the Subscription Manager.
Note
Typically, a resource will be either be a Consumer or a Producer. However, you can implement both in a single resource.
PortType Operations Properties
NotificationProducer Subscribe, GetCurrentMessage Topic, FixedTopicSet, TopicExpressionDialects
NotificationConsumer Notify
Note
In addition to operations, the NotificationProducer portType also includes three properties. If a WS-Resource implements this portType, it must also expose these 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 the 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 or WSN specification 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 of the Apache WSRF documentation.