Notifications SPS Examples Scenario
Copyright © 2011 Open Geospatial Consortium 169
task that is in execution. It sends the according Subscribe request to the producer endpoint stated by the SPS in the notifications section of its Capabilities document.
Listing 45 - Subscribe request example
soap12:Envelope xmlns:soap12
= http:www.w3.org200305soap-envelope
xmlns:sps =
http:www.opengis.netsps2.0 xmlns:wsa
= http:www.w3.org200508addressing
xmlns:xsi =
http:www.w3.org2001XMLSchema-instance xmlns:wsn-b
= http:docs.oasis-open.orgwsnb-2
soap12:Body wsn-b:Subscribe
wsn-b:ConsumerReference wsa:Address
http:my.client.comclientmyNotificationConsumer wsa:Address
wsn-b:ConsumerReference wsn-b:Filter
wsn-b:TopicExpression Dialect
= http:www.w3.orgTR1999REC-xpath-
19991116 sps:TaskEvent[wstop:topic=true]
wsn-b:TopicExpression wsn-b:MessageContent
Dialect =
http:www.w3.orgTR1999REC-xpath- 19991116
boolean[sps:task = http:www.ogc.orgprocedurecamera1tasks6] wsn-
b:MessageContent wsn-b:Filter
wsn-b:Subscribe soap12:Body
soap12:Envelope
2010-08-20T11:12:06+02:00 - The service sends a response indicating that the subscription will last until 2010-08-20T14:31:00+02:00.
This time is shortly after the requested task end time. Note, however, that in WS- Notification the choice of the actual termination time depends upon the actual service
implementation if no specific time was requested by the client. Although the way the default choice for termination time of a task as shown in this example is a useful pattern,
the SPS specification does not state requirements concerning the duration of a task or the termination time of subscriptions that may target notifications published for it. Such
requirements could be defined in an SPS extension.
Listing 46 - Subscribe response example
soap12:Envelope xmlns:soap12
= http:www.w3.org200305soap-envelope
xmlns:wsa =
http:www.w3.org200508addressing xmlns:xsi
= http:www.w3.org2001XMLSchema-instance
xmlns:wsn-b =
http:docs.oasis-open.orgwsnb-2 soap12:Body
wsn-b:SubscribeResponse wsn-b:SubscriptionReference
wsa:Address http:www.ogc.orgSPSProducersubscriptions792
wsa:Address wsn-b:SubscriptionReference
wsn-b:TerminationTime 2010-08-20T14:31:00+02:00
wsn-b:TerminationTime wsn-b:SubscribeResponse
soap12:Body soap12:Envelope
Following the examples given so far, the service would have published the following notifications for the task the client targeted in its subscription: a notification for a
TaskingRequestAccepted task was submitted, DataPublished and for a TaskCompleted event
170 Copyright © 2011 Open Geospatial Consortium
Listing 47 – Example notification of TaskingRequestAccepted event published on TaskSubmission topic
soap12:Envelope xmlns:soap12
= http:www.w3.org200305soap-envelope
xsi:schemaLocation =
http:www.w3.org200305soap-envelope http:www.w3.org200305soap-envelopesoap-envelope.xsd
http:www.opengis.netsps2.0 http:schemas.opengis.netsps2.0sps.xsd http:docs.oasis-open.orgwsnb-2 http:docs.oasis-open.orgwsnb-2.xsd
xmlns:sps =
http:www.opengis.netsps2.0 xmlns:wsa
= http:www.w3.org200508addressing
xmlns:xsi =
http:www.w3.org2001XMLSchema-instance xmlns:wsn-b
= http:docs.oasis-
open.orgwsnb-2 soap12:Header
wsa:To http:my.client.comclientmyNotificationConsumer
wsa:To wsa:Action
http:docs.oasis-open.orgwsnbw- 2NotificationConsumerNotify
wsa:Action soap12:Header
soap12:Body wsn-b:Notify
wsn-b:NotificationMessage wsn-b:SubscriptionReference
wsa:Address http:www.ogc.orgSPSProducersubscriptions792
wsa:Address wsn-b:SubscriptionReference
wsn-b:Topic Dialect
= http:docs.oasis-open.orgwsnt-
1TopicExpressionConcrete sps:TaskEventTaskSubmission
wsn-b:Topic wsn-b:Message
sps:StatusReport sps:task
http:www.ogc.orgprocedurecamera1tasks6 sps:task
sps:event TaskSubmitted
sps:event sps:percentCompletion
sps:percentCompletion sps:procedure
http:www.ogc.orgprocedurecamera1 sps:procedure
sps:requestStatus Accepted
sps:requestStatus sps:taskStatus
InExecution sps:taskStatus
sps:updateTime 2010-08-20T11:12:04+02:00
sps:updateTime sps:StatusReport
wsn-b:Message wsn-b:NotificationMessage
wsn-b:Notify soap12:Body
soap12:Envelope
Copyright © 2011 Open Geospatial Consortium 171
Listing 48 – Example notification of DataPublished event
soap12:Envelope xmlns:soap12
= http:www.w3.org200305soap-envelope
xmlns:sps =
http:www.opengis.netsps2.0 xmlns:wsa
= http:www.w3.org200508addressing
xmlns:xsi =
http:www.w3.org2001XMLSchema-instance xmlns:ows
= http:www.opengis.netows1.1
xmlns:wsn-b =
http:docs.oasis-open.orgwsnb- 2
soap12:Header wsa:To
http:my.client.comclientmyNotificationConsumer wsa:To
wsa:Action http:docs.oasis-open.orgwsnbw-
2NotificationConsumerNotify wsa:Action
soap12:Header soap12:Body
wsn-b:Notify wsn-b:NotificationMessage
wsn-b:SubscriptionReference wsa:Address
http:www.ogc.orgSPSProducersubscriptions792 wsa:Address
wsn-b:SubscriptionReference wsn-b:Topic
Dialect =
http:docs.oasis-open.orgwsnt- 1TopicExpressionConcrete
sps:TaskEventDataPublication wsn-b:Topic
wsn-b:Message sps:StatusReport
sps:task http:www.ogc.orgprocedurecamera1tasks6
sps:task sps:event
DataPublished sps:event
sps:procedure http:www.ogc.orgprocedurecamera1
sps:procedure sps:requestStatus
Accepted sps:requestStatus
sps:taskStatus InExecution
sps:taskStatus sps:updateTime
2010-08-20T12:37:00.001+02:00 sps:updateTime
sps:StatusReport wsn-b:Message
wsn-b:NotificationMessage wsn-b:Notify
soap12:Body soap12:Envelope
172 Copyright © 2011 Open Geospatial Consortium
Listing 49 – Example notification of TaskCompleted event
soap12:Envelope xmlns:soap12
= http:www.w3.org200305soap-envelope
xmlns:sps =
http:www.opengis.netsps2.0 xmlns:wsa
= http:www.w3.org200508addressing
xmlns:xsi =
http:www.w3.org2001XMLSchema-instance xmlns:ows
= http:www.opengis.netows1.1
xmlns:wsn-b =
http:docs.oasis-open.orgwsnb- 2
soap12:Header wsa:To
http:my.client.comclientmyNotificationConsumer wsa:To
wsa:Action http:docs.oasis-open.orgwsnbw-
2NotificationConsumerNotify wsa:Action
soap12:Header soap12:Body
wsn-b:Notify wsn-b:NotificationMessage
wsn-b:SubscriptionReference wsa:Address
http:www.ogc.orgSPSProducersubscriptions792 wsa:Address
wsn-b:SubscriptionReference wsn-b:Topic
Dialect =
http:docs.oasis-open.orgwsnt- 1TopicExpressionConcrete
sps:TaskEventTaskCompletion wsn-b:Topic
wsn-b:Message sps:StatusReport
sps:task http:www.ogc.orgprocedurecamera1tasks6
sps:task sps:event
TaskCompleted sps:event
sps:percentCompletion 100
sps:percentCompletion sps:procedure
http:www.ogc.orgprocedurecamera1 sps:procedure
sps:requestStatus Accepted
sps:requestStatus sps:taskStatus
Completed sps:taskStatus
sps:updateTime 2010-08-20T14:30:00+02:00
sps:updateTime sps:StatusReport
wsn-b:Message wsn-b:NotificationMessage
wsn-b:Notify soap12:Body
soap12:Envelope