Difference between revisions of "UBIK Web Service"
(→SOAP) |
|||
| (5 intermediate revisions by the same user not shown) | |||
| Line 6: | Line 6: | ||
* Updating Content objects (Update Contents) | * Updating Content objects (Update Contents) | ||
* Uploading a file Document (Upload Document ) | * Uploading a file Document (Upload Document ) | ||
| + | * CheckOur and release a set of Contents objects | ||
| Line 139: | Line 140: | ||
The <code>__type</code> property allows the JSON deserializer to find the correct class. [[https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/stand-alone-json-serialization?redirectedfrom=MSDN#polymorphism-1| Microsoft Documentation]]. | The <code>__type</code> property allows the JSON deserializer to find the correct class. [[https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/stand-alone-json-serialization?redirectedfrom=MSDN#polymorphism-1| Microsoft Documentation]]. | ||
| − | + | ||
==== SOAP ==== | ==== SOAP ==== | ||
| Line 164: | Line 165: | ||
Make sure to replace the application, context and authtoken accordingly! | Make sure to replace the application, context and authtoken accordingly! | ||
| − | + | ||
==== C# ==== | ==== C# ==== | ||
| Line 190: | Line 191: | ||
</source> | </source> | ||
| − | + | ||
=== Downloading Infrastructure Objects === | === Downloading Infrastructure Objects === | ||
| Line 212: | Line 213: | ||
Make sure to replace the <code><tags></code> accordingly! | Make sure to replace the <code><tags></code> accordingly! | ||
| − | + | ||
==== SOAP ==== | ==== SOAP ==== | ||
| Line 260: | Line 261: | ||
</source> | </source> | ||
| − | + | ||
=== Downloading branch === | === Downloading branch === | ||
| Line 308: | Line 309: | ||
Make sure to replace the application, context and authtoken accordingly! | Make sure to replace the application, context and authtoken accordingly! | ||
| − | + | ||
==== C# ==== | ==== C# ==== | ||
| Line 334: | Line 335: | ||
</source> | </source> | ||
| − | + | ||
= Download a Document = | = Download a Document = | ||
| Line 573: | Line 574: | ||
|- | |- | ||
|} | |} | ||
| + | |||
| + | ==== HTTP (REST) ==== | ||
| + | <source lang="html4strict" style="padding-bottom: 0; border-bottom: 0;"> | ||
| + | POST <CONTENT-PATH>/UBIKContent.svc/UpdateContentListV212/<APP>/<CTX>/<TOKEN>/<VERSION> HTTP/1.1 | ||
| + | Host: <HOSTNAME/IP>:<PORT> | ||
| + | Content-Type: application/json | ||
| + | </source> | ||
| + | <source lang="javascript" style="padding-top: 0; border-top: 0;"> | ||
| + | [ | ||
| + | { | ||
| + | "__type": "UbikContent:#UBIK.Service.DTO.V260", | ||
| + | "UID": "c02e668b-d400-41df-b7bc-ab3f1f31d250", | ||
| + | "PropertyValues": | ||
| + | [ | ||
| + | { | ||
| + | "__type": "TypePropertyValueOfstring:#UBIK.Service", | ||
| + | "MetaPropertyID": "4ec5281a-e0bd-4917-aff5-708352fc6953", | ||
| + | "ValidationTS":"/Date(1569942000000+0200)/", | ||
| + | "Value": "TESTVALUE" | ||
| + | }, | ||
| + | { | ||
| + | "__type": "TypePropertyValueOfNullableOfint:#UBIK.Service", | ||
| + | "MetaPropertyID": "7c95ec83-a399-4b47-b827-6d87795a7b19", | ||
| + | "ValidationTS":"/Date(1569942000000+0200)/", | ||
| + | "Value": 33 | ||
| + | } | ||
| + | ] | ||
| + | } | ||
| + | ] | ||
| + | </source> | ||
| + | Make sure to replace the <code><tags></code> accordingly! | ||
| + | |||
| + | The <code>__type</code> property allows the JSON deserializer to find the correct class. [[https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/stand-alone-json-serialization?redirectedfrom=MSDN#polymorphism-1| Microsoft Documentation]]. | ||
| + | |||
| + | |||
=== Code Example (C#) === | === Code Example (C#) === | ||
| Line 616: | Line 652: | ||
version); | version); | ||
</source> | </source> | ||
| − | |||
| − | |||
| Line 698: | Line 732: | ||
</source> | </source> | ||
| + | |||
| + | = Exclusive Access = | ||
| + | == CheckOut == | ||
| + | Tries to get exclusive access to all provided contents. | ||
| + | |||
| + | <source lang="csharp"> | ||
| + | [OperationContract] | ||
| + | [WebInvoke(UriTemplate = "CheckOut/{appName}/{contextName}/{authentication}/{version}", Method = "POST", | ||
| + | RequestFormat = WebMessageFormat.Json, | ||
| + | BodyStyle = WebMessageBodyStyle.Bare, | ||
| + | ResponseFormat = WebMessageFormat.Json)] | ||
| + | |||
| + | BCDataShipments CheckOut( | ||
| + | string appName, | ||
| + | string contextName, | ||
| + | string authentication, | ||
| + | UbikContent[] contents, | ||
| + | string version); | ||
| + | </source> | ||
| + | |||
| + | |||
| + | === List of Parameters === | ||
| + | {| class="wikitable" | width = "50%" | ||
| + | |- | ||
| + | ! Name!! Type !! Description | ||
| + | |- | ||
| + | | appName|| String || Name of the Application | ||
| + | |- | ||
| + | | contextName|| String || Name of the Context | ||
| + | |- | ||
| + | | authentication|| String || Valid auth token | ||
| + | |- | ||
| + | | contents|| UbikContent[] || Content objects to be checked out | ||
| + | |- | ||
| + | | version|| String || Indicator of the expected data format version | ||
| + | |- | ||
| + | |} | ||
| + | |||
| + | |||
| + | === Code Example (C#) === | ||
| + | <source lang="csharp"> | ||
| + | string appName = "APP_TEST"; | ||
| + | string contextName = "CTX_TEST"; | ||
| + | string authToken = FetchValidAuthToken(); | ||
| + | string version = "362"; | ||
| + | |||
| + | UbikContent content = new UbikContent() | ||
| + | { | ||
| + | // reference to the MetaDefinition | ||
| + | MetaClassID = new Guid("6b4bd904-8504-4e05-93dd-ae120d15a5be"), | ||
| + | // object => we must use the UID of an existing content object | ||
| + | UID = new Guid("6b4bd904-8504-4e05-93dd-ae120d15a5be") | ||
| + | }; | ||
| + | |||
| + | UBIKContentClient target = new UBIKContentClient(WEBSERVER_NAME); | ||
| + | |||
| + | BCDataShipments result = target.CheckOut( | ||
| + | appName, | ||
| + | contextName, | ||
| + | authToken, | ||
| + | new UbikContent[] { content }, | ||
| + | version); | ||
| + | </source> | ||
| + | |||
| + | == Release == | ||
| + | Tries to release the exclusive access to all provided contents. | ||
| + | |||
| + | <source lang="csharp"> | ||
| + | [OperationContract] | ||
| + | [WebInvoke(UriTemplate = "Release/{appName}/{contextName}/{authentication}/{version}", Method = "POST", | ||
| + | RequestFormat = WebMessageFormat.Json, | ||
| + | BodyStyle = WebMessageBodyStyle.Bare, | ||
| + | ResponseFormat = WebMessageFormat.Json)] | ||
| + | |||
| + | BCDataShipments Release( | ||
| + | string appName, | ||
| + | string contextName, | ||
| + | string authentication, | ||
| + | UbikContent[] contents, | ||
| + | string version); | ||
| + | </source> | ||
| + | |||
| + | |||
| + | === List of Parameters === | ||
| + | {| class="wikitable" | width = "50%" | ||
| + | |- | ||
| + | ! Name!! Type !! Description | ||
| + | |- | ||
| + | | appName|| String || Name of the Application | ||
| + | |- | ||
| + | | contextName|| String || Name of the Context | ||
| + | |- | ||
| + | | authentication|| String || Valid auth token | ||
| + | |- | ||
| + | | contents|| UbikContent[] || Content objects to be checked out | ||
| + | |- | ||
| + | | version|| String || Indicator of the expected data format version | ||
| + | |- | ||
| + | |} | ||
| + | |||
| + | |||
| + | === Code Example (C#) === | ||
| + | <source lang="csharp"> | ||
| + | string appName = "APP_TEST"; | ||
| + | string contextName = "CTX_TEST"; | ||
| + | string authToken = FetchValidAuthToken(); | ||
| + | string version = "362"; | ||
| + | |||
| + | UbikContent content = new UbikContent() | ||
| + | { | ||
| + | // reference to the MetaDefinition | ||
| + | MetaClassID = new Guid("6b4bd904-8504-4e05-93dd-ae120d15a5be"), | ||
| + | // object => we must use the UID of an existing content object | ||
| + | UID = new Guid("6b4bd904-8504-4e05-93dd-ae120d15a5be") | ||
| + | }; | ||
| + | |||
| + | UBIKContentClient target = new UBIKContentClient(WEBSERVER_NAME); | ||
| + | |||
| + | BCDataShipments result = target.Release( | ||
| + | appName, | ||
| + | contextName, | ||
| + | authToken, | ||
| + | new UbikContent[] { content }, | ||
| + | version); | ||
| + | </source> | ||
<headertabs /> | <headertabs /> | ||
[[Category:Server|Web Service]] | [[Category:Server|Web Service]] | ||
Latest revision as of 16:30, 4 April 2022
The following section describes the most important UBIK Webservice Methods used for
- Fetching information about the Datamodell (Fetch MetaDefinitions)
- Downloading Content objects (Download Content)
- Downloading Content File Documents (Download Document)
- Creating a single Content object (Create Content)
- Updating Content objects (Update Contents)
- Uploading a file Document (Upload Document )
- CheckOur and release a set of Contents objects
