guides:ws_payloads_lock_unlock_finalize
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
guides:ws_payloads_lock_unlock_finalize [2020/08/24 23:20] – brett.zamora | guides:ws_payloads_lock_unlock_finalize [2020/08/24 23:30] (current) – brett.zamora | ||
---|---|---|---|
Line 167: | Line 167: | ||
Payloads that are ' | Payloads that are ' | ||
- | The sample code snippet | + | The sample code snippets |
- | + | ||
- | These snippet of code was derived from the [[guides: | + | |
+ | These snippet of code was derived from the [[guides: | ||
+ | **Snippet 1: Lock/ | ||
Line 274: | Line 274: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | |||
+ | **Snippet 2: Finalize** | ||
+ | |||
+ | The following is just a fragment of code that was copied over from the [[guides: | ||
+ | |||
+ | <code C#> | ||
+ | var jsonResult2 = JsonConvert.DeserializeObject< | ||
+ | string strRemoteFileName = jsonResult2.result; | ||
+ | |||
+ | // You must finalize the remote file to change the extension from .tmp to .xml | ||
+ | | ||
+ | string strAction = " | ||
+ | |||
+ | strURL = null; | ||
+ | client = null; | ||
+ | request = null; | ||
+ | response = null; | ||
+ | |||
+ | strURL = " | ||
+ | |||
+ | client = new RestClient(strURL); | ||
+ | request = new RestRequest(Method.PATCH); | ||
+ | |||
+ | request.AddHeader(" | ||
+ | request.AddHeader(" | ||
+ | response = client.Execute(request); | ||
+ | |||
+ | if (response.IsSuccessful) | ||
+ | { | ||
+ | tbMessageLine.Text = "XML file " + strFileName+" | ||
+ | rc = true; | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | var jsonResult3 = JsonConvert.DeserializeObject< | ||
+ | string strMessage = jsonResult3.Exception.Message; | ||
+ | tbMessageLine.Text = strMessage; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
guides/ws_payloads_lock_unlock_finalize.1598311243.txt.gz · Last modified: by brett.zamora