Difference between revisions of "UBIK Web Service"
| Line 17: | Line 17: | ||
RequestFormat = WebMessageFormat.Json, | RequestFormat = WebMessageFormat.Json, | ||
ResponseFormat = WebMessageFormat.Json)] | ResponseFormat = WebMessageFormat.Json)] | ||
| − | BCMetaDefinitions GetMetaDefinitionsV212(String appName, String contextName, | + | BCMetaDefinitions GetMetaDefinitionsV212( |
| + | String appName, | ||
| + | String contextName, | ||
| + | String authentication, | ||
| + | String version); | ||
</source> | </source> | ||
| Line 42: | Line 46: | ||
string ctxName = "CTX_TEST"; | string ctxName = "CTX_TEST"; | ||
string authToken = FetchValidAuthToken(); | string authToken = FetchValidAuthToken(); | ||
| − | string | + | string version = "263"; |
| − | BCMetaDefinitions metaDefintions = target.GetMetaDefinitionsV212(appName, ctxName, authToken, | + | UBIKContentClient target = new UBIKContentClient(WEBSERVER_NAME); |
| + | BCMetaDefinitions metaDefintions = target.GetMetaDefinitionsV212( | ||
| + | appName, | ||
| + | ctxName, | ||
| + | authToken, | ||
| + | version); | ||
| + | </source> | ||
| + | |||
| + | == Download Content == | ||
| + | |||
| + | GetHierarchyDeltasV212 is used for downloading single objects as well as branches, root objects and the infrastructure. | ||
| + | |||
| + | <source lang="csharp"> | ||
| + | /// <summary> | ||
| + | /// The main method for downloading content. | ||
| + | /// This method is used for downloading single objects as well as branches, root objects and the infrastructure | ||
| + | /// </summary> | ||
| + | /// <param name="appName">Name of the application.</param> | ||
| + | /// <param name="contextName">Name of the context.</param> | ||
| + | /// <param name="args">The arguments.</param> | ||
| + | /// <param name="authentication">authentication (tokenid) for the user/device to access this service</param> | ||
| + | /// <param name="version">The versionindicator.</param> | ||
| + | /// <returns>a set of content objects</returns> | ||
| + | [OperationContract] | ||
| + | [WebInvoke(UriTemplate = "GetMetaDefinitionsV212/{appName}/{contextName}/{authentication}/{version}", Method = "GET", | ||
| + | RequestFormat = WebMessageFormat.Json, | ||
| + | ResponseFormat = WebMessageFormat.Json)] | ||
| + | BCHierarchyDeltaShipments GetHierarchyDeltasV212( | ||
| + | String appName, | ||
| + | String contextName, | ||
| + | HierarchyDeltaArguments args, | ||
| + | String authentication, | ||
| + | String version); | ||
| + | </source> | ||
| + | |||
| + | |||
| + | === List ofParameters === | ||
| + | {| class="wikitable" | width = "50%" | ||
| + | |- | ||
| + | ! Name!! Type !! Description | ||
| + | |- | ||
| + | | appName|| String || Name of the Application | ||
| + | |- | ||
| + | | contextName|| String || Name of the Context | ||
| + | |- | ||
| + | | args || HierarchyDeltaArguments || Defines the type of download (root, infra, branch) as well as the startobject and the download depth | ||
| + | |- | ||
| + | | authentication|| String || Valid auth token | ||
| + | |- | ||
| + | | version|| String || Indicator of the expected data format version | ||
| + | |- | ||
| + | |} | ||
| + | |||
| + | |||
| + | === Code Example (c#) === | ||
| + | Downloading Root Objects | ||
| + | |||
| + | <source lang="csharp"> | ||
| + | string appName = "APP_TEST"; | ||
| + | string ctxName = "CTX_TEST"; | ||
| + | string authToken = FetchValidAuthToken(); | ||
| + | string version = "263"; | ||
| + | |||
| + | HierarchyDeltaArguments args = new HierarchyDeltaArguments() | ||
| + | { | ||
| + | ChildrenDepth = 1, | ||
| + | ParentDepth = 0, | ||
| + | StartingPoint = new HierarchyRoot(), | ||
| + | }; | ||
| + | |||
| + | UBIKContentClient target = new UBIKContentClient(WEBSERVER_NAME); | ||
| + | BCHierarchyDeltaShipments roots = target.GetHierarchyDeltasV212( | ||
| + | appName, | ||
| + | ctxName, | ||
| + | args, | ||
| + | authToken, | ||
| + | version); | ||
| + | </source> | ||
| + | |||
| + | |||
| + | |||
| + | Downloading Infrastructure Objects | ||
| + | |||
| + | <source lang="csharp"> | ||
| + | string appName = "APP_TEST"; | ||
| + | string ctxName = "CTX_TEST"; | ||
| + | string authToken = FetchValidAuthToken(); | ||
| + | string version = "263"; | ||
| + | |||
| + | HierarchyDeltaArguments args = new HierarchyDeltaArguments() | ||
| + | { | ||
| + | ChildrenDepth = 1, | ||
| + | ParentDepth = 0, | ||
| + | StartingPoint = new HierarchyInfrastructure(), | ||
| + | }; | ||
| + | |||
| + | UBIKContentClient target = new UBIKContentClient(WEBSERVER_NAME); | ||
| + | BCHierarchyDeltaShipments roots = target.GetHierarchyDeltasV212( | ||
| + | appName, | ||
| + | ctxName, | ||
| + | args, | ||
| + | authToken, | ||
| + | version); | ||
| + | </source> | ||
| + | |||
| + | |||
| + | |||
| + | Downloading an entire branch starting at object with UID = '9E8FC21E-137E-4DDB-9D85-6E71B01F12FA' | ||
| + | |||
| + | <source lang="csharp"> | ||
| + | string appName = "APP_TEST"; | ||
| + | string ctxName = "CTX_TEST"; | ||
| + | string authToken = FetchValidAuthToken(); | ||
| + | string version = "263"; | ||
| + | |||
| + | HierarchyDeltaArguments args = new HierarchyDeltaArguments() | ||
| + | { | ||
| + | ChildrenDepth = 1, | ||
| + | ParentDepth = 0, | ||
| + | StartingPoint = new HierarchyStartingPoint(new Guid("9E8FC21E-137E-4DDB-9D85-6E71B01F12FA")) | ||
| + | }; | ||
| + | |||
| + | UBIKContentClient target = new UBIKContentClient(WEBSERVER_NAME); | ||
| + | BCHierarchyDeltaShipments roots = target.GetHierarchyDeltasV212( | ||
| + | appName, | ||
| + | ctxName, | ||
| + | args, | ||
| + | authToken, | ||
| + | version); | ||
</source> | </source> | ||
[[Category:Server|Web Service]] | [[Category:Server|Web Service]] | ||
Revision as of 08:35, 2 August 2019
Web Service Documentation
Contents
Fetch MetaDefinitions
Provides the configured ACM (see Application Context Management) Datemodell to the client.
/// <summary>
/// Delivers a list of all defined MetaClass Objects for the given Application and the given DeviceID
/// </summary>
/// <param name="appName">Name of the Application</param>
/// <param name="contextName">Name of the Context</param>
/// <param name="authentication">authentication (tokenid) for the user/device to access this service</param>
/// <returns>a list of MetaDefinitions</returns>
[OperationContract]
[WebInvoke(UriTemplate = "GetMetaDefinitionsV212/{appName}/{contextName}/{authentication}/{version}", Method = "GET",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
BCMetaDefinitions GetMetaDefinitionsV212(
String appName,
String contextName,
String authentication,
String version);
/// Delivers a list of all defined MetaClass Objects for the given Application and the given DeviceID
/// </summary>
/// <param name="appName">Name of the Application</param>
/// <param name="contextName">Name of the Context</param>
/// <param name="authentication">authentication (tokenid) for the user/device to access this service</param>
/// <returns>a list of MetaDefinitions</returns>
[OperationContract]
[WebInvoke(UriTemplate = "GetMetaDefinitionsV212/{appName}/{contextName}/{authentication}/{version}", Method = "GET",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
BCMetaDefinitions GetMetaDefinitionsV212(
String appName,
String contextName,
String authentication,
String version);
List ofParameters
| Name | Type | Description |
|---|---|---|
| appName | String | Name of the Application |
| contextName | String | Name of the Context |
| authentication | String | Valid auth token |
| version | String | Indicator of the expected data format version |
Code Example (c#)
string appName = "APP_TEST";
string ctxName = "CTX_TEST";
string authToken = FetchValidAuthToken();
string version = "263";
UBIKContentClient target = new UBIKContentClient(WEBSERVER_NAME);
BCMetaDefinitions metaDefintions = target.GetMetaDefinitionsV212(
appName,
ctxName,
authToken,
version);
string ctxName = "CTX_TEST";
string authToken = FetchValidAuthToken();
string version = "263";
UBIKContentClient target = new UBIKContentClient(WEBSERVER_NAME);
BCMetaDefinitions metaDefintions = target.GetMetaDefinitionsV212(
appName,
ctxName,
authToken,
version);
Download Content
GetHierarchyDeltasV212 is used for downloading single objects as well as branches, root objects and the infrastructure.
/// <summary>
/// The main method for downloading content.
/// This method is used for downloading single objects as well as branches, root objects and the infrastructure
/// </summary>
/// <param name="appName">Name of the application.</param>
/// <param name="contextName">Name of the context.</param>
/// <param name="args">The arguments.</param>
/// <param name="authentication">authentication (tokenid) for the user/device to access this service</param>
/// <param name="version">The versionindicator.</param>
/// <returns>a set of content objects</returns>
[OperationContract]
[WebInvoke(UriTemplate = "GetMetaDefinitionsV212/{appName}/{contextName}/{authentication}/{version}", Method = "GET",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
BCHierarchyDeltaShipments GetHierarchyDeltasV212(
String appName,
String contextName,
HierarchyDeltaArguments args,
String authentication,
String version);
/// The main method for downloading content.
/// This method is used for downloading single objects as well as branches, root objects and the infrastructure
/// </summary>
/// <param name="appName">Name of the application.</param>
/// <param name="contextName">Name of the context.</param>
/// <param name="args">The arguments.</param>
/// <param name="authentication">authentication (tokenid) for the user/device to access this service</param>
/// <param name="version">The versionindicator.</param>
/// <returns>a set of content objects</returns>
[OperationContract]
[WebInvoke(UriTemplate = "GetMetaDefinitionsV212/{appName}/{contextName}/{authentication}/{version}", Method = "GET",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
BCHierarchyDeltaShipments GetHierarchyDeltasV212(
String appName,
String contextName,
HierarchyDeltaArguments args,
String authentication,
String version);
List ofParameters
| Name | Type | Description |
|---|---|---|
| appName | String | Name of the Application |
| contextName | String | Name of the Context |
| args | HierarchyDeltaArguments | Defines the type of download (root, infra, branch) as well as the startobject and the download depth |
| authentication | String | Valid auth token |
| version | String | Indicator of the expected data format version |
Code Example (c#)
Downloading Root Objects
string appName = "APP_TEST";
string ctxName = "CTX_TEST";
string authToken = FetchValidAuthToken();
string version = "263";
HierarchyDeltaArguments args = new HierarchyDeltaArguments()
{
ChildrenDepth = 1,
ParentDepth = 0,
StartingPoint = new HierarchyRoot(),
};
UBIKContentClient target = new UBIKContentClient(WEBSERVER_NAME);
BCHierarchyDeltaShipments roots = target.GetHierarchyDeltasV212(
appName,
ctxName,
args,
authToken,
version);
string ctxName = "CTX_TEST";
string authToken = FetchValidAuthToken();
string version = "263";
HierarchyDeltaArguments args = new HierarchyDeltaArguments()
{
ChildrenDepth = 1,
ParentDepth = 0,
StartingPoint = new HierarchyRoot(),
};
UBIKContentClient target = new UBIKContentClient(WEBSERVER_NAME);
BCHierarchyDeltaShipments roots = target.GetHierarchyDeltasV212(
appName,
ctxName,
args,
authToken,
version);
Downloading Infrastructure Objects
string appName = "APP_TEST";
string ctxName = "CTX_TEST";
string authToken = FetchValidAuthToken();
string version = "263";
HierarchyDeltaArguments args = new HierarchyDeltaArguments()
{
ChildrenDepth = 1,
ParentDepth = 0,
StartingPoint = new HierarchyInfrastructure(),
};
UBIKContentClient target = new UBIKContentClient(WEBSERVER_NAME);
BCHierarchyDeltaShipments roots = target.GetHierarchyDeltasV212(
appName,
ctxName,
args,
authToken,
version);
string ctxName = "CTX_TEST";
string authToken = FetchValidAuthToken();
string version = "263";
HierarchyDeltaArguments args = new HierarchyDeltaArguments()
{
ChildrenDepth = 1,
ParentDepth = 0,
StartingPoint = new HierarchyInfrastructure(),
};
UBIKContentClient target = new UBIKContentClient(WEBSERVER_NAME);
BCHierarchyDeltaShipments roots = target.GetHierarchyDeltasV212(
appName,
ctxName,
args,
authToken,
version);
Downloading an entire branch starting at object with UID = '9E8FC21E-137E-4DDB-9D85-6E71B01F12FA'
string appName = "APP_TEST";
string ctxName = "CTX_TEST";
string authToken = FetchValidAuthToken();
string version = "263";
HierarchyDeltaArguments args = new HierarchyDeltaArguments()
{
ChildrenDepth = 1,
ParentDepth = 0,
StartingPoint = new HierarchyStartingPoint(new Guid("9E8FC21E-137E-4DDB-9D85-6E71B01F12FA"))
};
UBIKContentClient target = new UBIKContentClient(WEBSERVER_NAME);
BCHierarchyDeltaShipments roots = target.GetHierarchyDeltasV212(
appName,
ctxName,
args,
authToken,
version);
string ctxName = "CTX_TEST";
string authToken = FetchValidAuthToken();
string version = "263";
HierarchyDeltaArguments args = new HierarchyDeltaArguments()
{
ChildrenDepth = 1,
ParentDepth = 0,
StartingPoint = new HierarchyStartingPoint(new Guid("9E8FC21E-137E-4DDB-9D85-6E71B01F12FA"))
};
UBIKContentClient target = new UBIKContentClient(WEBSERVER_NAME);
BCHierarchyDeltaShipments roots = target.GetHierarchyDeltasV212(
appName,
ctxName,
args,
authToken,
version);
