Difference between revisions of "UBIK Push Web Service"
Line 31: | Line 31: | ||
The File 'UBIKPush.svc' contains the basic definition of the service: | The File 'UBIKPush.svc' contains the basic definition of the service: | ||
− | < | + | <source lang="xml"> |
<%@ ServiceHost Language="C#" Debug="true" Service="UBIK.Service.UBIKPush" CodeBehind="UBIKPush.svc.cs" %> | <%@ ServiceHost Language="C#" Debug="true" Service="UBIK.Service.UBIKPush" CodeBehind="UBIKPush.svc.cs" %> | ||
− | </ | + | </source > |
Line 39: | Line 39: | ||
The Endpoint of the Push Service must be configured in the Service section of the Web.Config file: | The Endpoint of the Push Service must be configured in the Service section of the Web.Config file: | ||
− | < | + | <source lang="xml"> |
<configuration> | <configuration> | ||
<system.serviceModel> | <system.serviceModel> | ||
Line 51: | Line 51: | ||
</system.serviceModel> | </system.serviceModel> | ||
</configuration> | </configuration> | ||
− | </ | + | </source> |
Line 59: | Line 59: | ||
The WebService provides a method to add content to be pushed to the clients: | The WebService provides a method to add content to be pushed to the clients: | ||
− | < | + | <source lang="csharp"> |
/// <summary> | /// <summary> | ||
/// AddUpdateInformation provides the possibility to register data to be forwarded (pushed) to the clients | /// AddUpdateInformation provides the possibility to register data to be forwarded (pushed) to the clients | ||
Line 71: | Line 71: | ||
ResponseFormat = WebMessageFormat.Json)] | ResponseFormat = WebMessageFormat.Json)] | ||
bool AddUpdateInformation(PushUpdateDefinition data); | bool AddUpdateInformation(PushUpdateDefinition data); | ||
− | </ | + | </source > |
Line 77: | Line 77: | ||
This method can be executed via a Webbrowswer as well: | This method can be executed via a Webbrowswer as well: | ||
− | < | + | <source lang="csharp"> |
/// <summary> | /// <summary> | ||
/// Delivers info about the current status of the Push Service. | /// Delivers info about the current status of the Push Service. | ||
Line 87: | Line 87: | ||
ResponseFormat = WebMessageFormat.Json)] | ResponseFormat = WebMessageFormat.Json)] | ||
string DebugInfo(string token); | string DebugInfo(string token); | ||
− | </ | + | </source> |
There is a possibility to trigger a reinitialization (reset) of the Push Web Service from outside. This method can be executed via a Webbrowswer as well. | There is a possibility to trigger a reinitialization (reset) of the Push Web Service from outside. This method can be executed via a Webbrowswer as well. | ||
− | < | + | <source lang="csharp"> |
/// <summary> | /// <summary> | ||
/// Resets the Cache of the Push Service | /// Resets the Cache of the Push Service | ||
Line 102: | Line 102: | ||
ResponseFormat = WebMessageFormat.Json)] | ResponseFormat = WebMessageFormat.Json)] | ||
void Reset(string token); | void Reset(string token); | ||
− | </ | + | </source> |
== Future Prospective == | == Future Prospective == | ||
Up to now (Version 2.3.1) there is no UI implementation for the Push Web Service. To guarantee an optimal integration of the Push Service to the UBIK Kernel a socket implementation of the Push Service is provided via the Environment. This socket class uses the web service methods to add data to the PushService. The Configura-tion of the WebService must be done as it is done for the LAS/GAS. | Up to now (Version 2.3.1) there is no UI implementation for the Push Web Service. To guarantee an optimal integration of the Push Service to the UBIK Kernel a socket implementation of the Push Service is provided via the Environment. This socket class uses the web service methods to add data to the PushService. The Configura-tion of the WebService must be done as it is done for the LAS/GAS. | ||
An instance of this Socket class is provided via the Ubik Environment. | An instance of this Socket class is provided via the Ubik Environment. |
Revision as of 08:46, 27 May 2014
While a normal Data Service (Content Service) delivers data when it is asked for (like Get-NextContentLevel) the Push Service is responsible for “pushing” data to every client.
The PushService works as central data hub. The Service has a set of methods to get the Update Information containing the data that must be pushed to the client defined by its criteria, by the sequence and by the last known status. The Service is aware of known devices and users and delivers the situation relevant update information. The service is capable of persisting the update data in the UBIK System as the PushService must deliver the correct data for every client.
Contents
Push Triggers
The Push Service supports following update triggers:
- Force update of single Content
- Force update of children of Content
- Force removing of single Content
- Force update of Infrastructure
- Force update of Root objects
- Force update of Metadefinitions
Push Criteria
The Push Service supports following criteria:
- Sequential
- Device dependent
- User dependent
- Location dependent (future version)
Configuration
Service
The UBIK Push Service is available since Version 2.3.1. As the Push Service uses the same configuration as the UBIK Content service it is recommended to configure the Push Service in the same folder as UBIKCOntent.svc. The File 'UBIKPush.svc' contains the basic definition of the service:
Endpoint
The Endpoint of the Push Service must be configured in the Service section of the Web.Config file:
<system.serviceModel>
<services>
...
<service name="UBIK.Service.UBIKPush" behaviorConfiguration="httpBehavior">
<endpoint address="" behaviorConfiguration="httpBehavior" binding="webHttpBinding" contract="UBIK.Service.IUBIKPush" />
<endpoint address="/SOAP" binding="wsHttpBinding" contract="UBIK.Service.IUBIKPush" />
</service>
</services>
</system.serviceModel>
</configuration>
Web Service Interface
The WebService provides a method to add content to be pushed to the clients:
/// AddUpdateInformation provides the possibility to register data to be forwarded (pushed) to the clients
/// </summary>
/// <param name="data">Data which should be pushed to the clients, and criteria which must be fullfilled for pushing</param>
/// <returns>true as adding the information was successfull</returns>
[OperationContract]
[WebInvoke(UriTemplate = "AddUpdateInformation", Method = "POST",
RequestFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Bare,
ResponseFormat = WebMessageFormat.Json)]
bool AddUpdateInformation(PushUpdateDefinition data);
The Push Web Service provides access to its current status via a debug - info method. You can use this to get info about the current status of the Web Service.
This method can be executed via a Webbrowswer as well:
/// Delivers info about the current status of the Push Service.
/// </summary>
/// <param name="token">authentication token</param>
[OperationContract]
[WebInvoke(UriTemplate = "DebugInfo/{token}", Method = "GET",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
string DebugInfo(string token);
There is a possibility to trigger a reinitialization (reset) of the Push Web Service from outside. This method can be executed via a Webbrowswer as well.
/// Resets the Cache of the Push Service
/// </summary>
/// <param name="token">authentication token</param>
[OperationContract]
[WebInvoke(UriTemplate = "Reset/{token}", Method = "GET",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
void Reset(string token);
Future Prospective
Up to now (Version 2.3.1) there is no UI implementation for the Push Web Service. To guarantee an optimal integration of the Push Service to the UBIK Kernel a socket implementation of the Push Service is provided via the Environment. This socket class uses the web service methods to add data to the PushService. The Configura-tion of the WebService must be done as it is done for the LAS/GAS. An instance of this Socket class is provided via the Ubik Environment.