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

9.6.9 Using WS-Addressing

Usually the communication between client and SPS can be performed via SOAP without the addition of WS-Addressing header information. However, in some cases it is useful to leverage the functionality provided by WS-Addressing. This document is not the place to give a tutorial on WS-Addressing. However, the following listings provide some examples of SPS operation requests and responses including a WS-Notification Subscribe invocation example where WS-Addressing header information is added to the SOAP messages. Listing 50 – GetCapabilities example using WS-Addressing header information 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 soap12:Header wsa:To http:www.ogc.orgSPS wsa:To wsa:Action http:www.opengis.netsps2.0GetCapabilities wsa:Action wsa:ReplyTo wsa:Address http:my.client.comclientmyReceiver wsa:Address wsa:ReplyTo wsa:MessageID http:my.client.comuidmsg-0010 wsa:MessageID soap12:Header soap12:Body sps:GetCapabilities soap12:Body soap12:Envelope Copyright © 2011 Open Geospatial Consortium 173 The meaning of the header fields is as follows: • wsa:To – address of the intended receiver of this message • wsa:Action – uniquely identifies the semantics implied by this message; in this example it tells the service that the SPS GetCapabilities operation is invoked • wsa:ReplyTo – the address of the endpoint where the response is expected to be sent to; in this example the response shall be sent asynchronously • wsa:MessageID – a unique identifier for the message which is also used in the response sent by the service later on so that the client knows to which request an incoming – asynchronously sent – response refers to The according reply would look like shown in the following listing. Listing 51 – Capabilities example using WS-Addressing header information 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:www.w3.org200508addressing http:www.w3.org200508addressingws-addr.xsd xmlns:sps = http:www.opengis.netsps2.0 xmlns:xlink = http:www.w3.org1999xlink xmlns:wsa = http:www.w3.org200508addressing xmlns:xsi = http:www.w3.org2001XMLSchema-instance xmlns:ows = http:www.opengis.netows1.1 xmlns:gml = http:www.opengis.netgml3.2 xmlns:swes = http:www.opengis.netswes2.0 xmlns:wstop = http:docs.oasis- open.orgwsnt-1 soap12:Header wsa:To http:my.client.comclientmyReceiver wsa:To wsa:Action http:www.opengis.netsps2.0GetCapabilitiesResponse wsa:Action wsa:RelatesTo http:my.client.comuidmsg-0010 wsa:RelatesTo soap12:Header soap12:Body -- like shown in Listing 11-- soap12:Body soap12:Envelope As we can see, the wsa:To has the value of the wsa:ReplyTo header field from the request shown in Listing 50 – same for the wsa:RelatesTo element which has the value of the wsa:MessageID from the request. The wsa:Action is now used to convey the information that the SOAP message contains the response to an SPS GetCapabilities invocation. The Subscribe request as shown in Listing 45 can also be augmented with WS- Addressing header information.