Changes

UBIK Web Service

3,640 bytes added, 16:28, 4 April 2022
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]].
[[Category:Server|Web Service]]
==== SOAP ====
Make sure to replace the application, context and authtoken accordingly!
[[Category:Server|Web Service]]
==== C# ====
</source>
[[Category:Server|Web Service]]
=== Downloading Infrastructure Objects ===
Make sure to replace the <code><tags></code> accordingly!
[[Category:Server|Web Service]]
==== SOAP ====
</source>
[[Category:Server|Web Service]]
=== Downloading branch ===
Make sure to replace the application, context and authtoken accordingly!
[[Category:Server|Web Service]]
==== C# ====
</source>
[[Category:Server|Web Service]]
= Download a Document =
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]].
[[Category:Server|Web Service]]
=== Code Example (C#) ===
</source>
[[Category:Server|Web Service]]
= Upload Document =
</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 updateContent = 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[] { updateContent },
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 updateContent = 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[] { updateContent },
version);
</source>
<headertabs />
[[Category:Server|Web Service]]
1,579
edits