guides:ws_store_checksum
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| guides:ws_store_checksum [2018/10/26 18:24] – brett.zamora | guides:ws_store_checksum [2019/06/04 23:51] (current) – brett.zamora | ||
|---|---|---|---|
| Line 9: | Line 9: | ||
| - | < | + | < |
| < | < | ||
| </ | </ | ||
| Line 19: | Line 19: | ||
| <color # | <color # | ||
| - | {{tablelayout? | + | {{tablelayout? |
| ^ Method ^ URL ^ | ^ Method ^ URL ^ | ||
| - | | POST | < | + | | POST | < |
| Line 34: | Line 34: | ||
| ^ Key ^ Value ^ | ^ Key ^ Value ^ | ||
| | Content-Type | application/ | | Content-Type | application/ | ||
| + | | access_token | {soft-token} | | ||
| Line 58: | Line 59: | ||
| **Endpoint: | **Endpoint: | ||
| - | < | + | < |
| Line 75: | Line 76: | ||
| - | **Sample Response:** | + | <color #7092be>Sample Response</ |
| Status Code: 200 | Status Code: 200 | ||
| Line 108: | Line 109: | ||
| Comments and sample code are provided for reference purposes only and are not intended to show all exception handling conditions and/or completed code blocks. | Comments and sample code are provided for reference purposes only and are not intended to show all exception handling conditions and/or completed code blocks. | ||
| + | |||
| + | |||
| + | **Comment 1:** | ||
| + | |||
| + | The StoreChecksum web service requires a Base64 encoded SHA384 checksum to be provided as one of the parameters. | ||
| + | Following is a C# / .NET sample code snippet that shows how to generate a SHA3 checksum and convert the hash to a Base64 string: | ||
| + | |||
| + | |||
| + | {{page> | ||
| + | |||
| + | |||
| + | **Comment 2:** | ||
| + | |||
| + | Following is a C# / .NET sample code snippet that shows how to call the StoreChecksum web service. Your code will supply the values for the various parameters based on the following: | ||
| + | |||
| + | |||
| + | {{tablelayout? | ||
| + | ^ Parameter ^ Source ^ | ||
| + | | checksum | The Base64 encoded value of the SHA384 binary checksum that was calculated for the DOCUMENT string. | ||
| + | |||
| + | |||
| + | <code C#> | ||
| + | Public static void StoreChecksumExample() | ||
| + | { | ||
| + | // In this example I am picking up the checksum value I calculated from a | ||
| + | // form field in the sample application that is available on this Wiki. | ||
| + | |||
| + | string strChecksumValue = tbChecksumValue.Text; | ||
| + | |||
| + | // The following value was obtained from your call to the Login web service. | ||
| + | |||
| + | string token = " | ||
| + | |||
| + | strURL = null; | ||
| + | client = null; | ||
| + | request = null; | ||
| + | response = null; | ||
| + | |||
| + | strURL = " | ||
| + | |||
| + | client = new RestClient(strURL); | ||
| + | request = new RestRequest(Method.POST); | ||
| + | |||
| + | strParms = " | ||
| + | strParms += strChecksumValue; | ||
| + | strParms += " | ||
| + | |||
| + | request.AddHeader(" | ||
| + | request.AddHeader(" | ||
| + | request.AddHeader(" | ||
| + | request.AddParameter(" | ||
| + | |||
| + | response = client.Execute(request); | ||
| + | |||
| + | if (response.IsSuccessful) | ||
| + | { | ||
| + | var jsonResult2 = JsonConvert.DeserializeObject< | ||
| + | string strChecksumKey = jsonResult2.checksum_key; | ||
| + | |||
| + | // (Agents) Update the RequestChecksumValue property of the PRIA_DOCUMENT node with the value of strChecksumKey | ||
| + | // or | ||
| + | // (Counties) Update the ResponseChecksumValue property of the PRIA_DOCUMENT node with the value of strChecksumKey | ||
| + | } | ||
| + | else | ||
| + | { | ||
| + | var jsonResult2 = JsonConvert.DeserializeObject< | ||
| + | string str_ErrorCode = jsonResult2.ToString(); | ||
| + | |||
| + | // Do something with the error result | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | |||
| + | **Comment 3:** | ||
| + | |||
| + | Please note that before calling the CeRTNA web services you must establish the SecurityProtocol in your ServicePointManager. An example is shown below. The currently recommended protocol is Tls12. | ||
| + | |||
| + | <code C#> | ||
| + | public MainWindow() | ||
| + | { | ||
| + | InitializeComponent(); | ||
| + | System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | | ||
| + | SecurityProtocolType.Tls11 | | ||
| + | SecurityProtocolType.Tls12 | | ||
| + | SecurityProtocolType.Ssl3; | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | |||
| + | **Comment 4:** | ||
| + | |||
| + | CeRTNA has posted a simple [[: | ||
| + | |||
| + | |||
| + | **Comment 5:** | ||
| + | |||
| + | A nice utility for experimenting with web service calls is POSTMAN. You can download a free version of POSTMAN from the following URL: https:// | ||
guides/ws_store_checksum.1540578258.txt.gz · Last modified: by brett.zamora
