Interface Description of the 52°North Sensor Event Service
The interface of the 52N SES is based on the
OGC Sensor Event Service Discussion Paper. Nevertheless, some adjustments have been made. In particular, the filter expression language has been changed from using the Filter Encoding Specification 1.1.0 to version 2.0 since it became an approved OGC standard. This article shall give all needed information on how to build requests to use with the 52N SES.
HTTP Binding
The SES only supports HTTP Post requests for interface communication. One exception is the
GetCapabilities method which can also be accessed through a GET request. All other requests sent to the SES have to be encoded using
SOAP 1.2.
For convenience, the 52N SES also provides a HTTP Get landing page. Here, links to the available interfaces and their WSDL descriptions are summarized.
Web Service Notification
The
Web Service Notifications specifications is a family of standards developed by
OASIS. It defines interfaces and Requests/Responses to enable web services with interoperable publish/subscribe functionality. The default binding of the SES is based upon
SOAP 1.2.
WS Base Notification
"(The WS-N specification) defines a role called the NotificationProducer. A NotificationProducer is capable of producing a set of Notification messages. A NotificationProducer accepts incoming Subscribe requests. Each Subscribe request contains a reference to a NotificationConsumer and identifies the subset of the Notifications the NotificationProducer should produce. This subset can be described by identifying one or more boolean filters, including filtering by Topic, as discussed in [WS-Topics]. The NotificationProducer agrees to produce Notification Messages as requested in the Subscribe request, or returns a fault if the subscription cannot be handled.
The production of Notifications may be realized in a number of ways. One particular configuration, in which the NotificationProducer reproduces Notifications produced by other entities, is described in the [WS-BrokeredNotification] specification. Alternatively, a NotificationProducer may produce Notifications itself. An implementer interested only in such direct, point-to-point, notification need only refer to this WS-BaseNotification specification." -- taken from the
WS-N Specification.
The 52N SES implements both the
NotificationProducer and the
NotificationConsumer. It is thus capable of retrieving and producing/publishing Notification messages.
Besides these two resources the 52N SES implements the
SubscriptionManager interface. It provides functionality to pause/renew/remove a subscription instance.
WS Brokered Notification
"(The WS-BN specification) defines the Web services interface for the NotificationBroker. A NotificationBroker is an intermediary between message Publishers and message Subscribers. A NotificationBroker decouples NotificationProducers and Notification Consumers and can provide advanced messaging features such as demand-based publishing and load-balancing. A NotificationBroker also allows publication of messages from entities that are not themselves service providers. This is very similar to a traditional Message Oriented Middleware model.
The NotificationBroker interface includes standard message exchanges to be implemented by NotificationBroker service providers along with operational requirements expected of service providers and requestors that participate in brokered notifications." -- taken from the
WS-BN Specification.
As previously stated, the SES implements the Producer and Consumer side of the WS-N specification. Used in combination with the
SubscriptionManager, these two interfaces build the basis for the
NotificationBroker implementation of the SES. Publishers can send messages to the SES, and consumers can subscribe for a specific subset of theses messages.
WS Resources
Both specifications make use of the
WS Resources specification. It defines interfaces for management of resources. E.g., every
SubscriptionManager is a resource and thus can be removed using the Destroy method defined by this specification. The SES uses the interfaces to manage the lifetime and state of resources.
WS Addressing
The
WS-Addressing specification is used for basic addressing capabilities within requests and responses. Consumers and Producers are represented as WS-Addressing endpoints (
wsa:To
and
wsa:From
).
Interface Methods
This section introduces each interface method by describing its functionality as well as providing working XML examples.
Port Types and URLs
The 52N SES provides in general three port types where requests can be addressed to.
The methods described in the following subsections must be directed to the appropriate Port Type as listed in the above table ("Supported Methods").
GetCapabilities
The retrieval of the service Capabilities is quiet straightforward. You can use a request as specified below or access the Capabilities through a simple GET request.
GET Request
http://your-ses.inst:server-port/52n-ses-[version]?request=GetCapabilities
POST Request
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">${ses_host}</wsa:To>
<wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">http://www.opengis.net/ses/GetCapabilitiesRequest</wsa:Action>
<wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:2ff4a75b-bfbf-8aff-f2eb-315871d23978</wsa:MessageID>
<wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
</wsa:From>
</soap:Header>
<soap:Body>
<ses:GetCapabilities service="SES" xmlns:ses="http://www.opengis.net/ses/0.0" />
</soap:Body>
</soap:Envelope>
Subscribe
The Subscribe method can be used by a user to define the (sub)set of messages he is interested in. Here, Filter of all three levels can be defined. Every Subscribe request has to define a
ConsumerReference
Level 1 Example
The following example is a Subscription using an XPath expression. The SES will check every incoming message against this expression and forward it to the
wsa:Address
as defined in the
wsnt:ConsumerReference
. Here, the expression checks if there is an
om:procedure
(mostly the producing sensor) has an attribute
xlink:href
with value "urn:ogc:object:procedure:CITE:WeatherService:LGA". By defining a filter this way, you can easily subscribe for messages from only a single sensor.
An XPath filter can also be used to subscribe for every single message. Simply use an asterisk (
<wsnt:MessageContent Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116">*</wsnt:MessageContent>
) within your filter.
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
<soap:Header>
<wsa:To>${ses_host}</wsa:To>
<wsa:Action>http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeRequest</wsa:Action>
<wsa:MessageID>uuid:4e595160-185a-9b3c-3eb6-592c7c5b0c7a</wsa:MessageID>
<wsa:From>
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
</wsa:From>
</soap:Header>
<soap:Body>
<wsnt:Subscribe>
<wsnt:ConsumerReference>
<wsa:Address>${consumer}</wsa:Address>
</wsnt:ConsumerReference>
<wsnt:Filter>
<wsnt:MessageContent Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:om="http://www.opengis.net/om/1.0">
//om:Observation/om:procedure/@xlink:href='water_gauge_sensor-1'
</wsnt:MessageContent>
</wsnt:Filter>
</wsnt:Subscribe>
</soap:Body>
</soap:Envelope>
Level 2 Example
Level-2 Filters can be used to define spatial, comparison and temporal filters. The following example defines a spatial filter using a
LinearRing. If an incoming message provides a valid geometry, the Subscription will evaluate if it is within the
LinearRing.
Note that "input/geometry" must be used as the content of
fes:ValueReference
to define the correct reference to the geometry of an incoming message.
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">${ses_host}</wsa:To>
<wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">
http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeRequest
</wsa:Action>
<wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">
uuid:1b4d3025-f80a-a5b6-aa37-864c47fa1a7e
</wsa:MessageID>
<wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
</wsa:From>
</env:Header>
<env:Body>
<wsnt:Subscribe xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
<wsnt:ConsumerReference>
<wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing">${consumer}</wsa:Address>
</wsnt:ConsumerReference>
<wsnt:Filter>
<wsnt:MessageContent Dialect="http://www.opengis.net/ses/filter/level2">
<fes:Filter xmlns="http://www.opengis.net/wfs" xmlns:fes="http://www.opengis.net/fes/2.0"
xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:ows="http://www.opengis.net/ows"
xmlns:swe="http://www.opengis.net/swe/1.0.1">
<fes:Within>
<fes:ValueReference>input/geometry</fes:ValueReference>
<fes:Literal>
<gml:Polygon gml:id="aoi_01">
<gml:exterior>
<gml:LinearRing>
<gml:posList>58.0 3.0 40.0 3.0 40.0 -1.0 58.0 -1.0</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</fes:Literal>
</fes:Within>
</fes:Filter>
</wsnt:MessageContent>
</wsnt:Filter>
</wsnt:Subscribe>
</env:Body>
</env:Envelope>
Level 3 Example
The 52N SES supports the definition of Level-3 filters. In particular, a user can define filters to detect patterns in streams of messages by providing EML content. The following example illustrates the use of multiple patterns and the combination of these.
The starting point form two
SimplePattern instances which operate on the overall stream of incoming messages.
The attribute
inputName
of all occuring
SimplePatterns has to be the same within a Subscription. The first pattern subsets the incoming message by defining
PropertyRestrictions (sensorID and observedProperty) and the FES 2.0 comparison filter
fes:PropertyIsGreaterThan
(water_gauge > 0.5). The second is the logical inversion of the comparison filter (water_gauge <= 0.5). Therefore, all messages of this sensor are separated into two different streams. The name of these streams is defined in the
SelectionFunctions'
newEventName
attribute of both patterns.
Both
SimplePatterns act as inputs for the
ComplexPattern. It uses the
StructuralOperator BEFORE
to define a relation between both streams. A pattern match is detected whenever a message of the second
SimplePattern (undershoot) is followed by a message of the first
SimplePattern. A user can use such a filter if he is interested in certain contextual events of one sensor rather than the whole set of messages.
<SOAP-ENV:Envelope xmlns:ses="http://www.opengis.net/ses/0.0"
xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:essf="http://www.opengis.net/es-sf/0.0"
xmlns:wsn-b="http://docs.oasis-open.org/wsn/b-2" xmlns:wsn-br="http://docs.oasis-open.org/wsn/br-2"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header>
<wsa:Action>http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeRequest</wsa:Action>
<wsa:To>${ses_host}</wsa:To>
<wsa:From>
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
</wsa:From>
<wsa:MessageID>67424983-3e09-435e-863f-f6dea68802af</wsa:MessageID>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<wsn-b:Subscribe>
<wsn-b:ConsumerReference>
<wsa:Address>${consumer}</wsa:Address>
</wsn-b:ConsumerReference>
<wsn-b:Filter>
<wsn-b:MessageContent Dialect="http://www.opengis.net/ses/filter/level3">
<EML xmlns="http://www.opengis.net/eml/0.0.1">
<SimplePatterns>
<SimplePattern inputName="BAW_META" patternID="BAW_META">
<SelectFunctions>
<SelectFunction newEventName="BAW_META">
<NotifyOnSelect>
<Message><format>SES_OUTPUT</format>
<userID>223</userID></Message>
</NotifyOnSelect>
</SelectFunction>
</SelectFunctions>
<PropertyRestrictions>
<PropertyRestriction>
<name>observedProperty</name>
<value>THIS_OBS_PROP_DOES_NOT_EXIST</value>
</PropertyRestriction>
</PropertyRestrictions>
</SimplePattern>
<SimplePattern inputName="input"
patternID="Wasserstand_LIST_AUF_SYLT_over_undershoot_overshoot_stream">
<SelectFunctions>
<SelectFunction createCausality="false"
newEventName="Wasserstand_LIST_AUF_SYLT_over_undershoot_overshoot">
<SelectEvent eventName="input"/>
</SelectFunction>
</SelectFunctions>
<View>
<LengthView>
<EventCount>1</EventCount>
</LengthView>
</View>
<Guard>
<fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0">
<fes:PropertyIsGreaterThan>
<fes:ValueReference>input/doubleValue</fes:ValueReference>
<fes:Literal>
<swe:Quantity xmlns:swe="http://www.opengis.net/swe/1.0.1">
<swe:uom code="cm"/>
<swe:value>460.0</swe:value>
</swe:Quantity>
</fes:Literal>
</fes:PropertyIsGreaterThan>
</fes:Filter>
</Guard>
<PropertyRestrictions>
<PropertyRestriction>
<name>observedProperty</name>
<value>Wasserstand</value>
</PropertyRestriction>
<PropertyRestriction>
<name>sensorID</name>
<value>Wasserstand-List_Auf_Sylt_9570070</value>
</PropertyRestriction>
</PropertyRestrictions>
</SimplePattern>
<SimplePattern inputName="input"
patternID="Wasserstand_LIST_AUF_SYLT_over_undershoot_undershoot_stream">
<SelectFunctions>
<SelectFunction createCausality="false"
newEventName="Wasserstand_LIST_AUF_SYLT_over_undershoot_undershoot">
<SelectEvent eventName="input"/>
</SelectFunction>
</SelectFunctions>
<View>
<LengthView>
<EventCount>1</EventCount>
</LengthView>
</View>
<Guard>
<fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0">
<fes:PropertyIsLessThanOrEqualTo>
<fes:ValueReference>input/doubleValue</fes:ValueReference>
<fes:Literal>
<swe:Quantity xmlns:swe="http://www.opengis.net/swe/1.0.1">
<swe:uom code="cm"/>
<swe:value>460.0</swe:value>
</swe:Quantity>
</fes:Literal>
</fes:PropertyIsLessThanOrEqualTo>
</fes:Filter>
</Guard>
<PropertyRestrictions>
<PropertyRestriction>
<name>observedProperty</name>
<value>Wasserstand</value>
</PropertyRestriction>
<PropertyRestriction>
<name>sensorID</name>
<value>Wasserstand-List_Auf_Sylt_9570070</value>
</PropertyRestriction>
</PropertyRestrictions>
</SimplePattern>
</SimplePatterns>
<ComplexPatterns>
<!--Einstiegsklausel-->
<ComplexPattern patternID="Wasserstand_LIST_AUF_SYLT_over_undershoot_overshoot_notification_stream">
<SelectFunctions>
<SelectFunction createCausality="true"
newEventName="Wasserstand_LIST_AUF_SYLT_over_undershoot_overshoot_notification"
outputName="Wasserstand_LIST_AUF_SYLT_over_undershoot_enter">
<NotifyOnSelect>
<Message>Einstiegsklausel</Message>
</NotifyOnSelect>
</SelectFunction>
</SelectFunctions>
<StructuralOperator>
<BEFORE/>
</StructuralOperator>
<FirstPattern>
<PatternReference>Wasserstand_LIST_AUF_SYLT_over_undershoot_undershoot_stream</PatternReference>
<SelectFunctionNumber>0</SelectFunctionNumber>
</FirstPattern>
<SecondPattern>
<PatternReference>Wasserstand_LIST_AUF_SYLT_over_undershoot_overshoot_stream</PatternReference>
<SelectFunctionNumber>0</SelectFunctionNumber>
</SecondPattern>
</ComplexPattern>
<ComplexPattern patternID="Wasserstand_LIST_AUF_SYLT_over_undershoot_undershoot_notification">
<SelectFunctions>
<SelectFunction createCausality="true"
newEventName="Wasserstand_LIST_AUF_SYLT_over_undershoot_undershoot_notification_stream"
outputName="Wasserstand_LIST_AUF_SYLT_over_undershoot_exit">
<NotifyOnSelect>
<Message>Ausstiegsklausel</Message>
</NotifyOnSelect>
</SelectFunction>
</SelectFunctions>
<StructuralOperator>
<BEFORE/>
</StructuralOperator>
<FirstPattern>
<PatternReference>Wasserstand_LIST_AUF_SYLT_over_undershoot_overshoot_stream</PatternReference>
<SelectFunctionNumber>0</SelectFunctionNumber>
</FirstPattern>
<SecondPattern>
<PatternReference>Wasserstand_LIST_AUF_SYLT_over_undershoot_undershoot_stream</PatternReference>
<SelectFunctionNumber>0</SelectFunctionNumber>
</SecondPattern>
</ComplexPattern>
</ComplexPatterns>
<TimerPatterns/>
<RepetitivePatterns/>
</EML>
</wsn-b:MessageContent>
</wsn-b:Filter>
</wsn-b:Subscribe>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Response
A response to a Subscribe request looks like the following. The value of
wsa-muse:ResourceId
is the service-wide unique ID for this Subscription and has to be used when managing it (e.g. remove, pause, etc).
The element
wsa:Metadata
provides valuable information about the management of the Subscription. First of all, it defines a link to the WSDL of the
SubscriptionManager. By processing the contents of the WSDL a client is capable of identifying the correct address for managing this subscription on the fly. In particular this means that a client only needs to know where to direct the first request (namely the Subscribe request) and by processing the response is then capable of directing the management requests to the correct endpoint addresses without a-priori knowledge. This is exactly how the
52N SES Client framework deals with Subscriptions.
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">
http://www.w3.org/2005/08/addressing/role/anonymous</wsa:To>
<wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">
http://docs.oasis-open.org/wsn/bw-2/NotificationProduce/SubscribeResponse</wsa:Action>
<wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:a51490b6-5e7a-486d-0702-97abd6e13ce6
</wsa:MessageID>
<wsa:RelatesTo xmlns:wsa="http://www.w3.org/2005/08/addressing" RelationshipType="wsa:Reply">uuid:4e595160-185a-9b3c-3eb6-592c7c5b0c7a</wsa:RelatesTo>
<wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://localhost:8080/52n-ses-1.1.0/services/Broker</wsa:Address>
</wsa:From>
</soap:Header>
<soap:Body>
<wsnt:SubscribeResponse xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
<wsnt:SubscriptionReference>
<wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing">
http://localhost:8080/52n-ses-1.1.0/services/SubscriptionManager</wsa:Address>
<wsa:ReferenceParameters xmlns:wsa="http://www.w3.org/2005/08/addressing">
<muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">Subscription-2
</muse-wsa:ResourceId>
</wsa:ReferenceParameters>
<wsa:Metadata xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:NS1="http://www.w3.org/ns/wsdl-instance"
NS1:wsdlLocation="http://www.opengis.net/ses/0.0 http://localhost:8080/52n-ses-1.1.0/services/SubscriptionManager?wsdl"
xmlns:sesinst="http://www.opengis.net/ses/0.0">
<InterfaceName xmlns="http://www.w3.org/2007/05/addressing/metadata">sesinst:SubscriptionManager
</InterfaceName>
<ServiceName xmlns="http://www.w3.org/2007/05/addressing/metadata"
EndpointName="SubscriptionManagerPort">sesinst:SubscriptionManagerService</ServiceName>
</wsa:Metadata>
</wsnt:SubscriptionReference>
<wsnt:CurrentTime>2013-03-05T16:37:05+01:00</wsnt:CurrentTime>
</wsnt:SubscribeResponse>
</soap:Body>
</soap:Envelope>
Management
Unsubscribe
Removing a Subscription from the 52N SES can be done via a simple Unsubscribe request as illustrated by the following example.
Note the
muse-wsa:ResourceId
inside the
soap:Header
which acts as an identifier for the Subscription.
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
<soap:Header>
<wsa:To>${ses_sub_host}</wsa:To>
<wsa:Action>http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/UnsubscribeRequest</wsa:Action>
<wsa:MessageID>uuid:4e595160-185a-9b3c-3eb6-592c7c5b0c7a</wsa:MessageID>
<wsa:From>
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
</wsa:From>
<muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/addressing" wsa:IsReferenceParameter="true">
Subscription-2
</muse-wsa:ResourceId>
</soap:Header>
<soap:Body>
<wsnt:Unsubscribe/>
</soap:Body>
</soap:Envelope>
Pause
Pausing and resuming a Subscription is as simple as unsubscribing:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
<soap:Header>
<wsa:To>${ses_sub_host}</wsa:To>
<wsa:Action>http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/PauseSubscriptionRequest</wsa:Action>
<wsa:MessageID>uuid:4e595160-185a-9b3c-3eb6-592c7c5b0c7a</wsa:MessageID>
<wsa:From>
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
</wsa:From>
<muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing"
wsa:IsReferenceParameter="true">
Subscription-2
</muse-wsa:ResourceId>
</soap:Header>
<soap:Body>
<wsnt:PauseSubscription/>
</soap:Body>
</soap:Envelope>
Resume
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
<soap:Header>
<wsa:To>${ses_sub_host}</wsa:To>
<wsa:Action>http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/ResumeSubscriptionRequest</wsa:Action>
<wsa:MessageID>uuid:4e595160-185a-9b3c-3eb6-592c7c5b0c7a</wsa:MessageID>
<wsa:From>
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
</wsa:From>
<muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing"
wsa:IsReferenceParameter="true">
Subscription-2
</muse-wsa:ResourceId>
</soap:Header>
<soap:Body>
<wsnt:ResumeSubscription/>
</soap:Body>
</soap:Envelope>
The termination time of a subscription can be updated via a request similar to the following.
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsrf-rl="http://docs.oasis-open.org/wsrf/rl-2" xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wsn-b="http://docs.oasis-open.org/wsn/b-2" xmlns:wsn-br="http://docs.oasis-open.org/wsn/br-2"
xmlns:wsn-t="http://docs.oasis-open.org/wsn/t-1" xmlns:wsntw="http://docs.oasis-open.org/wsn/bw-2"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header>
<wsa:Action>http://docs.oasis-open.org/wsrf/rlw-2/ScheduledResourceTermination/SetTerminationTimeRequest</wsa:Action>
<wsa:To>${ses_sub_host}</wsa:To>
<wsa:From>
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
</wsa:From>
<wsa:MessageID>1410b537-aeea-43b6-a0fd-eeb97d2ff829</wsa:MessageID>
<muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing" wsa:IsReferenceParameter="true">
Subscription-2
</muse-wsa:ResourceId>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<wsrf-rl:SetTerminationTime>
<wsrf-rl:RequestedTerminationTime>2013-10-07T10:01:46+01:00</wsrf-rl:RequestedTerminationTime>
</wsrf-rl:SetTerminationTime>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Using Stored Filters (since 1.1.0)
With version 1.1.0 we integrated a new feature called "Stored Filters". The concept is quiet similar to Web Feature Service Stored Queries: The service maintains a set of filter template which ca be easily parameterized by a client. In the following a few examples are presented.
The schemas have been developed within the OGC OWS-9 testbed. They are stored inside the webapp of the SES at
/WEB-INF/classes/wsdl/OGC-SES-SF-0_0-sesStoredFilter.xsd or accessible via the OWS-9 public test repository.
Discovery
The SES provides a dedicated method to list the IDs of all available Stored Filters.
Request
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:essf="http://www.opengis.net/es-sf/0.0"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wsbn="http://docs.oasis-open.org/wsn/br-2"
xmlns:wsrf="http://docs.oasis-open.org/wsrf/rl-2">
<soap:Header>
<wsa:To>${ses_host}</wsa:To>
<wsa:Action>http://www.opengis.net/es-sf/ListStoredFiltersRequest</wsa:Action>
<wsa:MessageID>uuid:d5850046-3d5e-7338-5880-1f19252ac665</wsa:MessageID>
<wsa:From>
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
</wsa:From>
</soap:Header>
<soap:Body>
<essf:ListStoredFilters />
</soap:Body>
</soap:Envelope>
Response
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/role/anonymous</wsa:To>
<wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">http://www.opengis.net/es-sf/ListStoredFiltersResponse</wsa:Action>
<wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:c27e81a4-aca0-f532-eeeb-f41d195d6b6d</wsa:MessageID>
<wsa:RelatesTo xmlns:wsa="http://www.w3.org/2005/08/addressing" RelationshipType="wsa:Reply">uuid:d5850046-3d5e-7338-5880-1f19252ac665</wsa:RelatesTo>
<wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://localhost:8080/52n-ses-1.1.0/services/Broker</wsa:Address>
</wsa:From>
</soap:Header>
<soap:Body>
<ListStoredFiltersResponse xmlns="http://www.opengis.net/es-sf/0.0">
<StoredFilterID>urn:ogc:def:filter:OGC-ES::SubscribeForFeatureType</StoredFilterID>
<StoredFilterID>urn:ogc:def:filter:OGC-ES::SubscribeForFlightRouteBuffer</StoredFilterID>
<StoredFilterID>urn:ogc:def:filter:OGC-ES::SubscribeForFeatureTypeAndExcludeMetadata</StoredFilterID>
<StoredFilterID>urn:ogc:def:filter:OGC-ES::SubscribeForFeatureTypeWithinWiderFlightRouteBuffer</StoredFilterID>
<StoredFilterID>urn:ogc:def:filter:OGC-ES::SubscribeForFeatureTypeWithinFlightRouteBuffer</StoredFilterID>
</ListStoredFiltersResponse>
</soap:Body>
</soap:Envelope>
You can use the StoredFilterID of a previously used ListStoredFilters response to obtain details on the Stored Filter.
Request
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:essf="http://www.opengis.net/es-sf/0.0"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wsbn="http://docs.oasis-open.org/wsn/br-2"
xmlns:wsrf="http://docs.oasis-open.org/wsrf/rl-2">
<soap:Header>
<wsa:To>${ses_host}</wsa:To>
<wsa:Action>http://www.opengis.net/es-sf/DescribeStoredFilterRequest</wsa:Action>
<wsa:MessageID>uuid:d5850046-3d5e-7338-5880-1f19252ac665</wsa:MessageID>
<wsa:From>
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
</wsa:From>
</soap:Header>
<soap:Body>
<essf:DescribeStoredFilter>
<essf:StoredFilterID>urn:ogc:def:filter:OGC-ES::SubscribeForFeatureType</essf:StoredFilterID>
</essf:DescribeStoredFilter>
</soap:Body>
</soap:Envelope>
Response
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/role/anonymous</wsa:To>
<wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">http://www.opengis.net/es-sf/DescribeStoredFilterResponse</wsa:Action>
<wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:f5524f36-5b17-bd20-7580-75fee25295f5</wsa:MessageID>
<wsa:RelatesTo xmlns:wsa="http://www.w3.org/2005/08/addressing" RelationshipType="wsa:Reply">uuid:d5850046-3d5e-7338-5880-1f19252ac665</wsa:RelatesTo>
<wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://localhost:8080/52n-ses-1.1.0/services/Broker</wsa:Address>
</wsa:From>
</soap:Header>
<soap:Body>
<DescribeStoredFilterResponse xmlns="http://www.opengis.net/es-sf/0.0">
<essf:StoredFilterDescription id="urn:ogc:def:filter:OGC-ES::SubscribeForFeatureType" xmlns:essf="http://www.opengis.net/es-sf/0.0">
<essf:Title xmlns="http://www.opengis.net/es-sf/0.0">SubscribeForFeatureType</essf:Title>
<essf:Abstract xmlns="http://www.opengis.net/es-sf/0.0">Filter for selecting notifications on a specific feature
type. This stored filter accepts the following arguments: 1/ argument
'typename'</essf:Abstract>
<essf:Parameter name="typename" type="xs:string">
<essf:Abstract>the typename of a feature expressed as a qualified name (e.g. aixm:Runway)</essf:Abstract>
</essf:Parameter>
<essf:FilterExpressionText isPrivate="false" language="urn:ogc:def:queryLanguage:OGC-ES::ES_FilterExpression">
<wsnt:Filter xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
<wsnt:MessageContent Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:aixm="http://www.aixm.aero/schema/5.1">
//${typename} </wsnt:MessageContent> </wsnt:Filter> </essf:FilterExpressionText>
</essf:StoredFilterDescription>
</DescribeStoredFilterResponse>
</soap:Body>
</soap:Envelope>
Subscribing
The parameters as listed in the DescribeStoredFilter response can then be used to easily customize a (complex) Stored Filter
<SOAP-ENV:Envelope xmlns:ses="http://www.opengis.net/ses/0.0" xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:essf="http://www.opengis.net/es-sf/0.0" xmlns:wsn-b="http://docs.oasis-open.org/wsn/b-2"
xmlns:wsntw="http://docs.oasis-open.org/wsn/bw-2" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header>
<wsa:Action>http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeRequest</wsa:Action>
<wsa:To>${ses_host}</wsa:To>
<wsa:From>
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
</wsa:From>
<wsa:MessageID>67424983-3e09-435e-863f-f6dea68802af</wsa:MessageID>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<wsn-b:Subscribe>
<wsn-b:ConsumerReference>
<wsa:Address>${consumer}</wsa:Address>
</wsn-b:ConsumerReference>
<wsn-b:Filter>
<wsn-b:MessageContent Dialect="http://www.opengis.net/es-sf/0.0">
<essf:StoredFilterSubscription id="urn:ogc:def:filter:OGC-ES::SubscribeForFeatureType">
<essf:ParameterValue name="typename">aixm:AirportHeliport</essf:ParameterValue>
</essf:StoredFilterSubscription>
</wsn-b:MessageContent>
</wsn-b:Filter>
</wsn-b:Subscribe>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Notify
O&M is only one possible language which the SES is capable to process. Nonetheless, it is suitable for many cases. The following example shows a Notify request which can be used with the previously described SensorEventServiceInterface.
O&M Example
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
<soap:Header>
<wsa:To>${ses_host}</wsa:To>
<wsa:Action>http://docs.oasis-open.org/wsn/bw-2/NotificationConsumer/Notify</wsa:Action>
<wsa:MessageID>uuid:1b4d3025-f80a-a5b6-aa37-864c47fa1a7e</wsa:MessageID>
<wsa:From>
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
</wsa:From>
</soap:Header>
<soap:Body>
<wsnt:Notify>
<wsnt:NotificationMessage>
<wsnt:Topic Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Simple">
Measurements
</wsnt:Topic>
<wsnt:Message>
<om:Observation gml:id="ot_279501-4"
xmlns:gml="http://www.opengis.net/gml"
xmlns:om="http://www.opengis.net/om/1.0"
xmlns:sa="http://www.opengis.net/sampling/1.0"
xmlns:swe="http://www.opengis.net/swe/1.0.1"
xmlns:xlink="http://www.w3.org/1999/xlink">
<om:samplingTime>
<gml:TimePeriod>
<gml:beginPosition>2011-09-10T01:54:00.000+02:00</gml:beginPosition>
<gml:endPosition>2011-09-10T01:54:00.000+02:00</gml:endPosition>
</gml:TimePeriod>
</om:samplingTime>
<om:procedure xlink:href="water_gauge_sensor-1"/>
<om:observedProperty xlink:href="water_gauge" />
<om:featureOfInterest>
<gml:FeatureCollection>
<gml:featureMember>
<sa:SamplingPoint
gml:id="water_gauge_sensor-1">
<gml:name>water_gauge_sensor-1</gml:name>
<sa:sampledFeature xlink:href="urn:ogc:def:nil:OGC:unknown"/>
<sa:position>
<gml:Point>
<gml:pos srsName="urn:ogc:def:crs:EPSG:31466">56.023 2.581</gml:pos>
</gml:Point>
</sa:position>
</sa:SamplingPoint>
</gml:featureMember>
</gml:FeatureCollection>
</om:featureOfInterest>
<om:result>
<swe:DataArray>
<swe:elementCount>
<swe:Count>
<swe:value>1</swe:value>
</swe:Count>
</swe:elementCount>
<swe:elementType name="Components">
<swe:DataRecord>
<swe:field name="Time">
<swe:Time definition="urn:ogc:data:time:iso8601"/>
</swe:field>
<swe:field name="feature">
<swe:Text definition="urn:ogc:data:feature"/>
</swe:field>
<swe:field name="water_gauge">
<swe:Quantity definition="water_gauge">
<swe:uom code="m"/>
</swe:Quantity>
</swe:field>
</swe:DataRecord>
</swe:elementType>
<swe:encoding>
<swe:TextBlock
blockSeparator=";"
decimalSeparator="." tokenSeparator=","/>
</swe:encoding>
<swe:values>2011-09-10T01:54:00.000+02:00,water_gauge,0.56;</swe:values>
</swe:DataArray>
</om:result>
</om:Observation>
</wsnt:Message>
</wsnt:NotificationMessage>
</wsnt:Notify>
</soap:Body>
</soap:Envelope>
Response
Since the 52N SES is implemented in compliance with the WS-N specifications, it simply returns a 204 No Content
as the HTTP status code for a Notify request. Thus, the notifiying client will not get feedback if the message was successfully processed or not. Such a response behavior has the benefit that it has quick response times and hence does not block a client application.
Registering a Publisher at the SES is not mandatory for most cases. Nevertheless, there are some situations where a registration is needed. This could be the case if a Subscription refers to a certain property of a NotificationMessage which relies on knowledge of the underlying unit of measurement used. A RegisterPublisher request must contain a SensorML definition. The following example illustrates the use of this request.
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
xmlns:sml="http://www.opengis.net/sensorML/1.0.1" xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wsn-b="http://docs.oasis-open.org/wsn/b-2" xmlns:wsn-br="http://docs.oasis-open.org/wsn/br-2"
xmlns:wsn-t="http://docs.oasis-open.org/wsn/t-1" xmlns:wsntw="http://docs.oasis-open.org/wsn/bw-2"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header>
<wsa:Action>http://docs.oasis-open.org/wsn/brw-2/RegisterPublisher/RegisterPublisherRequest</wsa:Action>
<wsa:To>${ses_host}</wsa:To>
<wsa:From>
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
</wsa:From>
<wsa:MessageID>1410b537-aeea-43b6-a0fd-eeb97d2ff829</wsa:MessageID>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<wsn-br:RegisterPublisher>
<wsn-br:Topic Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Simple">test-topic</wsn-br:Topic>
<wsn-br:Demand>false</wsn-br:Demand>
<sml:SensorML version="1.0.1" xmlns:gml="http://www.opengis.net/gml" xmlns:swe="http://www.opengis.net/swe/1.0.1">
<sml:member>
<sml:System gml:id="ses-test0.0.1a">
<sml:identification>
<sml:IdentifierList>
<sml:identifier>
<sml:Term definition="urn:ogc:def:identifier:OGC:1.0:uniqueID">
<sml:value>urn:ogc:object:test:dummypublisher2</sml:value>
</sml:Term>
</sml:identifier>
<sml:identifier>
<sml:Term definition="urn:ogc:def:identifier:OGC:1.0:longName">
<sml:value>Dummy Publisher for the SES</sml:value>
</sml:Term>
</sml:identifier>
<sml:identifier>
<sml:Term definition="urn:ogc:def:identifier:OGC:1.0:shortName">
<sml:value>DummySESv1</sml:value>
</sml:Term>
</sml:identifier>
</sml:IdentifierList>
</sml:identification>
<sml:outputs>
<sml:OutputList>
<sml:output name="water_gauge">
<swe:Quantity definition="urn:ogc:def:property:OGC:1.0:gauge"/>
</sml:output>
</sml:OutputList>
</sml:outputs>
</sml:System>
</sml:member>
</sml:SensorML>
</wsn-br:RegisterPublisher>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Response
Within the response the publisher retrieves the URL where to publish future notifications to (wsnt:ConsumerReference
). The URL within the PublisherRegistrationReference
must be used to manage the Registration.
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">
http://www.w3.org/2005/08/addressing/role/anonymous
</wsa:To>
<wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">
http://docs.oasis-open.org/wsn/brw-2/RegisterPublisher/RegisterPublisherResponse
</wsa:Action>
<wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">
uuid:60c0bb1a-1405-a519-d10a-a5deed6b148f
</wsa:MessageID>
<wsa:RelatesTo xmlns:wsa="http://www.w3.org/2005/08/addressing" RelationshipType="wsa:Reply">
uuid:d5850046-3d5e-7338-5880-1f19252ac665
</wsa:RelatesTo>
<wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://localhost:8080/52n-ses-core-1.0-SNAPSHOT/services/Broker</wsa:Address>
</wsa:From>
</soap:Header>
<soap:Body>
<RegisterPublisherResponse xmlns="http://docs.oasis-open.org/wsn/brw-2">
<wsnt:TerminationTime xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">3008-08-06T15:46:56+02:00</wsnt:TerminationTime>
<PublisherRegistrationReference xmlns="http://docs.oasis-open.org/wsn/br-2">
<wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing">
http://localhost:8080/52n-ses-core-1.0-SNAPSHOT/services/PublisherRegistrationManager
</wsa:Address>
<wsa:ReferenceParameters xmlns:wsa="http://www.w3.org/2005/08/addressing">
<muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">Publisher-1</muse-wsa:ResourceId>
</wsa:ReferenceParameters>
</PublisherRegistrationReference>
<wsnt:ConsumerReference xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
<wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing">
http://localhost:8080/52n-ses-core-1.0-SNAPSHOT/services/Broker
</wsa:Address>
</wsnt:ConsumerReference>
</RegisterPublisherResponse>
</soap:Body>
</soap:Envelope>
Management
Destroy
Removing a Publisher can be achieved by posting a request similar to the following.
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
<soap:Header>
<wsa:To>${reg_pub_host}</wsa:To>
<wsa:Action>
http://docs.oasis-open.org/wsn/brw-2/PublisherRegistrationManager/DestroyRegistrationRequest
</wsa:Action>
<wsa:MessageID>uuid:4e595160-185a-9b3c-3eb6-592c7c5b0c7a</wsa:MessageID>
<wsa:From>
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
</wsa:From>
<muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing"
wsa:IsReferenceParameter="1">
Publisher-1
</muse-wsa:ResourceId>
</soap:Header>
<soap:Body>
<wsnbr:DestroyRegistration xmlns:wsnbr="http://docs.oasis-open.org/wsn/br-2" />
</soap:Body>
</soap:Envelope>
The termination time of a subscription can be updated via a request similar to the following.
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsrf-rl="http://docs.oasis-open.org/wsrf/rl-2" xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wsn-b="http://docs.oasis-open.org/wsn/b-2" xmlns:wsn-br="http://docs.oasis-open.org/wsn/br-2"
xmlns:wsn-t="http://docs.oasis-open.org/wsn/t-1" xmlns:wsntw="http://docs.oasis-open.org/wsn/bw-2"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header>
<wsa:Action>http://docs.oasis-open.org/wsrf/rlw-2/ScheduledResourceTermination/SetTerminationTimeRequest</wsa:Action>
<wsa:To>${reg_pub_host}</wsa:To>
<wsa:From>
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
</wsa:From>
<wsa:MessageID>1410b537-aeea-43b6-a0fd-eeb97d2ff829</wsa:MessageID>
<muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing" wsa:IsReferenceParameter="true">
Publisher-1
</muse-wsa:ResourceId>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<wsrf-rl:SetTerminationTime>
<wsrf-rl:RequestedTerminationTime>2013-10-07T10:01:46+01:00</wsrf-rl:RequestedTerminationTime>
</wsrf-rl:SetTerminationTime>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
JMeter testplan
All previously provided requests are available as a JMeter project. Within this project you can find a "Configuration" element. This is the place where you should define the URLs (your SES_INSTANCE and similar) where the requests should be addressed to.