Version 18.2 by Nico Lemaire on 2024/04/05 16:34

Show last authors
1 {{toc/}}
2
3
4 = Digital Lab Exchange process =
5
6 The flow diagram gives a small overview of what the data flow of a lab assignment is. Every green block shows a step of the lab assignment process. From top to bottom these steps are:
7 ~==> nle what green blocks?
8
9 1. Showing the laboratory and all the analyses that can be requested as an option to the user.
10 1. The user creating a lab assignment and sending it to the lab trough TerraIndex.
11 1. The lab delivering the analysis results back to the TerraIndex.
12
13 [[attach:Lab exchange.svg||rel="noopener noreferrer" target="_blank"]] [[attach:Lab exchange.txt||rel="noopener noreferrer" target="_blank"]]
14
15 [[image:1712326465681-980.png||height="315" width="630"]]
16
17 [[image:1712326492306-381.png||height="781" width="635"]]
18
19 [[image:1712326520488-924.png||height="312" width="632"]]
20
21
22 (% class="wikigeneratedid" element-id="1884" %)
23 ~==> nle Perhaps add option download labcertificate
24
25 (% class="wikigeneratedid" element-id="1884" %)
26 = =
27
28 (% element-id="1884" %)
29 = (% element-id="1883" %)Firewall IP-Addresses of TerraIndex(%%) =
30
31 (% element-id="1882" %)
32 Our IP-addresses:
33
34 (% element-id="1881" %)
35 inbound [[Web.terraindex.com>>url:http://Web.terraindex.com||element-id="1880"]]
36 137.116.199.164
37
38 (% element-id="1878" %)
39 outbound [[Test.terraindex.com>>url:http://Test.terraindex.com||element-id="1877"]]
40 104.45.9.128
41
42 (% element-id="1875" %)
43 Production outbound
44 40.115.34.64
45
46 (% element-id="1873" %)
47 Test outbound
48 13.73.138.173
49
50 (% element-id="1871" %)
51 CD/CI outbound
52 40.114.238.16
53
54 (% element-id="1869" %)
55 Office outbound
56 213.124.115.132
57
58
59 (% element-id="1864" %)
60 = (% element-id="1863" %)Labdelivery (menu-card) files Exchange(%%) =
61
62 (% element-id="1862" %)
63 == (% element-id="1861" %)Solution/Design(%%) ==
64
65
66 (% class="table-hover" element-id="1858" %)
67 (% element-id="1856" %)|(% element-id="1855" %)(% element-id="1854" %)**Action**|(% element-id="1853" %)(% element-id="1852" %)**TerraIndex**|(% element-id="1851" %) |(% element-id="1849" %)(% element-id="1848" %)**Laboratorium**|(% element-id="1847" %)(% element-id="1846" %)**Parameters/Message**|(% element-id="1845" %)(% element-id="1844" %)**Remarks**|(% element-id="1843" %)(% element-id="1842" %)**ResultCodes**
68 (% element-id="1841" %)|(% element-id="1840" %)1|(% element-id="1839" %)Sends a request to the function: GetCustomers().|=(% element-id="1838" %)>|(% element-id="1837" %) |(% element-id="1835" %)(% element-id="1834" %)**WebserviceUsername (string), **(%%)
69 (% element-id="1832" %)**WebservicePassword (string),**(%%)
70 (% element-id="1830" %)**CustomerUsername (string)**|(% element-id="1829" %) |(% element-id="1827" %)
71 (% element-id="1825" %)|(% element-id="1824" %)2|(% element-id="1823" %) |(% element-id="1821" %) |(% element-id="1819" %)Receives the request and check the customers this username and searches the dateLastChanged for this Customer.|(% element-id="1818" %) |(% element-id="1816" %) |(% element-id="1814" %)
72 (% element-id="1812" %)|(% element-id="1811" %)3|(% element-id="1810" %) |(% element-id="1808" %)<=|(% element-id="1807" %)Sends back the list of customers with the lastChangedTimestamp|(% element-id="1806" %)ResultCode (),
73 ErrorMessage (string),
74 List<customer> , Customer:
75 CustomerCode (string),
76 CustomerName (string),
77 LabID (int),
78 LabName (string),
79 ChangedTimeStamp (DateTime)|(% element-id="1798" %)We receive the dateTimestamp instead of sending it, so we always get the full list and we are also able to delete customercodes.|(% element-id="1797" %)1 = Success,
80 2 = GeneralError,
81 3 = WrongSIKBVersion,
82 4 = InvalidCredentials,
83 5 = CustomerUsernameInvalid,
84 6 = CustomerUsernameNotValidForCustomerCode
85 7 = FileContentProblem,
86 8 = InvalidOrderId,
87 9 = OrderIdAlreadyApproved
88 10 = PDFNotAvailable
89 (% element-id="1787" %)|(% element-id="1786" %)4|(% element-id="1785" %)Receives the list of Customers, and will check for each customer it needs to request a new/changed labdelivery file based on the ChangedTimestamp.|(% element-id="1784" %) |(% element-id="1782" %) |(% element-id="1780" %) |(% element-id="1778" %)If a customer is not longer in this list, TerraIndex can remove this customercode from the customer database.|(% element-id="1777" %)
90 (% element-id="1775" %)|(% element-id="1774" %)5|(% element-id="1773" %)Sends a request to the function: GetProductList() if it has changed.|=(% element-id="1772" %)>|(% element-id="1771" %) |(% element-id="1769" %)(% element-id="1768" %)**WebserviceUsername (string), **(%%)
91 (% element-id="1766" %)**WebservicePassword (string),**(%%)
92 (% element-id="1764" %)**CustomerUsername (string),**(%%)
93 LabID (int),
94 CustomerCode (string),
95 LanguageCode (string, default 'nld' volgens ISO 639-3-codes),
96 SIKBVersion (string, default: '13.4.0'),
97 UseZipStream/UseZip (bool, default: 'false')|(% element-id="1758" %)(% element-id="1757" %)
98 (((
99 (% element-id="1756" %)
100 We start with dutch, then extend with multiple languages, TerraIndex is in the lead to request multiple languages.
101 TerraIndex uses: 'fra', 'nld', 'eng', 'spa', 'deu', 'ita', 'por', 'dan'
102
103
104 (% element-id="1752" %)
105 Besides SIKB 13.4.0, TerraIndex also supports 9.0.0/8.0.0 etc.
106
107 (% element-id="1752" %)
108 ~==> nle Do you want to mention these old versions?
109 )))|(% element-id="1751" %)
110 (% element-id="1749" %)|(% element-id="1748" %)6|(% element-id="1747" %) |(% element-id="1745" %) |(% element-id="1743" %)Reveives a request to create a labdelivery file in a certain version of SIKB. It will generate the file.|(% element-id="1742" %) |(% element-id="1740" %) |(% element-id="1738" %)
111 (% element-id="1736" %)|(% element-id="1735" %)7|(% element-id="1734" %) |(% element-id="1732" %)<=|(% element-id="1731" %)Sends back the SIKB file, as a Base64 encoded string, with or without using a zipstream.|(% element-id="1730" %)ResultCode (),
112 ErrorMessage (string),
113 FileContent_Base64 (string),
114 UseZipStream/UseZip (bool, default: 'false')|(% element-id="1726" %) |(% element-id="1724" %)1 = Success,
115 2 = GeneralError,
116 3 = WrongSIKBVersion,
117 4 = InvalidCredentials,
118 5 = CustomerUsernameInvalid,
119 6 = CustomerUsernameNotValidForCustomerCode
120 7 = FileContentProblem,
121 8 = InvalidOrderId,
122 9 = OrderIdAlreadyApproved
123 10 = PDFNotAvailable
124 (% element-id="1714" %)|(% element-id="1713" %)8|(% element-id="1712" %)Receives the DeliveryFile and saves the file for import into customer database.|(% element-id="1711" %) |(% element-id="1709" %) |(% element-id="1707" %) |(% element-id="1705" %) |(% element-id="1703" %)
125 (% element-id="1701" %)|(% element-id="1700" %)9|(% element-id="1699" %)Go back to step 5, for every Customer code, every language.|(% element-id="1698" %) |(% element-id="1696" %) |(% element-id="1694" %) |(% element-id="1692" %) |(% element-id="1690" %)
126 (% element-id="1688" %)|(% element-id="1687" %)10|(% element-id="1686" %)Process the LabDeliveryFiles|(% element-id="1685" %) |(% element-id="1683" %) |(% element-id="1681" %) |(% element-id="1679" %) |(% element-id="1677" %)
127
128 (% element-id="1675" %)
129 == (% element-id="1674" %)Get Customers (POST)(%%) ==
130
131 (% element-id="1673" %)
132 === (% element-id="1672" %)Request example(%%) ===
133
134 (% element-id="1671" %)
135 (% element-id="1669" %)|(% element-id="1668" %)(% element-id="1667" %)
136 (((
137 {{code language="C#"}}
138 public GetCustomersCall.Response GetCustomers(string WebserviceUsername, string WebservicePassword, string CustomerUsername)
139         {
140             GetCustomersCall.Response set = new GetCustomersCall.Response();
141
142             try
143             {
144                 var content = new FormUrlEncodedContent(new[]
145                 {
146                     new KeyValuePair<string, string>("userName", WebserviceUsername),
147                     new KeyValuePair<string, string>("password", WebservicePassword),
148                     new KeyValuePair<string, string>("customerUsername", CustomerUsername),
149                 });
150
151                 HttpResponseMessage response = _HttpClient.PostAsync(_HttpClient.BaseAddress + "/GetCustomers", content).Result;
152                 response.EnsureSuccessStatusCode();
153                 string responseMessage = response.Content.ReadAsStringAsync().Result;
154
155                 if (string.IsNullOrEmpty(responseMessage))
156                 {
157                     throw new Exception("Empty response from: [" + _HttpClient.BaseAddress + " / GetCustomers" + "]");
158                 }
159                 using (var ms = new System.IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(responseMessage)))
160                 {
161                     XmlSerializer serializer = new XmlSerializer(typeof(GetCustomersCall.Response));
162                     set = (GetCustomersCall.Response)serializer.Deserialize(ms);                 
163                 }
164             }
165             catch (Exception ex)
166             {
167                 #region handle exception
168                 set.Status = new BusinessEntities.LabRestService.GetCustomersCall.ResponseStatus();
169                 set.Status.StatusCode = ((int)ResultCodes.GeneralError).ToString();               
170                 set.Status.ErrorMessage = "Exception occurred in GetCustomers (username: " + WebserviceUsername + ", password: " + WebservicePassword + ") with message: " + ex.Message;
171                 ex.Data.Add("WebserviceUsername", WebserviceUsername);
172                 ex.Data.Add("WebservicePassword", WebservicePassword);
173                 ex.Data.Add("CustomerUsername", CustomerUsername);
174                 ExceptionHandler.HandleException(ex);
175                 #endregion
176             }
177             return set;
178         }
179 {{/code}}
180
181 (% element-id="1566" %)
182
183 )))
184
185 (% element-id="1564" %)
186 (% element-id="1562" %)|(% element-id="1561" %)(% element-id="1560" %)
187 (((
188 (% element-id="1559" %)
189 POST https:~/~/<URL>/GetCustomers HTTP/1.1
190
191 (% element-id="1558" %)
192 Content-Type: application/x-www-form-urlencoded
193
194 (% element-id="1557" %)
195 Host: 81.175.89.24
196
197 (% element-id="1556" %)
198 Content-Length: 115
199
200 (% element-id="1555" %)
201 Expect: 100-continue
202
203
204 (% element-id="1552" %)
205 userName=<webservice_username>&password=<Webservice_password>&customerUsername=<customer_username or token>
206 )))
207
208 (% element-id="1551" %)
209 === (% element-id="1550" %)Response example(%%) ===
210
211 (% element-id="1549" %)
212 (% element-id="1547" %)|(% element-id="1546" %)(% element-id="1545" %)
213 (((
214 {{code language="XML"}}
215 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
216 <Response><Customers>
217   <Customer LabId="1" LabName="Example Laboratorium" CustomerId="300" CustomerName="Adviesbureau De bodemkoning - Rotterdam" LastModifiedOnClient="2019-05-08T11:05:14.17+02:00" ></Customer>
218   <Customer LabId="1" LabName="Example Laboratorium" CustomerId="656" CustomerName="Adviesbureau De bodemkoning - Delft" LastModifiedOnClient="2019-04-19T13:20:10.123+02:00" ></Customer>
219 </Customers>
220 <Status>
221     <StatusCode>1</StatusCode>
222     <StatusCodeDescription>OK</StatusCodeDescription>
223     <ErrorMessage></ErrorMessage>
224 </Status>
225 </Response>
226 {{/code}}
227
228 (% element-id="1492" %)
229
230 )))
231
232 (% element-id="1490" %)
233 == (% element-id="1489" %)Get Products (POST)(%%) ==
234
235 (% element-id="1488" %)
236 === (% element-id="1487" %)Request example(%%) ===
237
238 (% element-id="1486" %)
239 (% element-id="1484" %)|(% element-id="1483" %)(% element-id="1482" %)
240 (((
241 (% element-id="1481" %)
242 public GetProductsCall.Response GetProductList(string WebserviceUsername, string WebservicePassword, string CustomerUsername, string customerid, int labid, string sikbVersion, string languageCode)
243
244 (% element-id="1480" %)
245 {
246
247
248 (% element-id="1477" %)
249 GetProductsCall.Response set = new GetProductsCall.Response();
250
251
252 (% element-id="1474" %)
253 try
254
255 (% element-id="1473" %)
256 {
257
258 (% element-id="1472" %)
259 bool useZipstream = true;
260
261 (% element-id="1471" %)
262 var content = new FormUrlEncodedContent(new[]
263
264 (% element-id="1470" %)
265 {
266
267 (% element-id="1469" %)
268 new KeyValuePair<string, string>("userName", WebserviceUsername),
269
270 (% element-id="1468" %)
271 new KeyValuePair<string, string>("password", WebservicePassword),
272
273 (% element-id="1467" %)
274 new KeyValuePair<string, string>("customerUsername", CustomerUsername),
275
276 (% element-id="1466" %)
277 new KeyValuePair<string, string>("languageCode", languageCode),
278
279 (% element-id="1465" %)
280 new KeyValuePair<string, string>("clientId", customerid),
281
282 (% element-id="1464" %)
283 new KeyValuePair<string, string>("sikbVersion", sikbVersion),
284
285 (% element-id="1463" %)
286 new KeyValuePair<string, string>("useZip", useZipstream.ToString() ),
287
288 (% element-id="1462" %)
289 });
290
291
292 (% element-id="1459" %)
293 HttpResponseMessage response = _HttpClient.PostAsync(_HttpClient.BaseAddress + "/GetProducts", content).Result;
294
295 (% element-id="1458" %)
296 response.EnsureSuccessStatusCode();
297
298 (% element-id="1457" %)
299 string responseMessage = response.Content.ReadAsStringAsync().Result;
300
301
302 (% element-id="1454" %)
303 if (string.IsNullOrEmpty(responseMessage))
304
305 (% element-id="1453" %)
306 {
307
308 (% element-id="1452" %)
309 throw new Exception("Empty response from: [" + _HttpClient.BaseAddress + " /GetProducts" + "]");
310
311 (% element-id="1451" %)
312 }
313
314 (% element-id="1450" %)
315 using (var ms = new System.IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(responseMessage~)~)~)
316
317 (% element-id="1449" %)
318 {
319
320 (% element-id="1448" %)
321 XmlSerializer serializer = new XmlSerializer(typeof(GetProductsCall.Response));
322
323 (% element-id="1447" %)
324 set = (GetProductsCall.Response)serializer.Deserialize(ms);
325
326 (% element-id="1446" %)
327 }
328
329
330 (% element-id="1443" %)
331 if (useZipstream && !string.IsNullOrEmpty(set.FileContent))
332
333 (% element-id="1442" %)
334 {
335
336 (% element-id="1441" %)
337 ~/~/convert from base64 string back to normal
338
339 (% element-id="1440" %)
340 ~/~/first check for real Base64, by checking there is no 'xml'  in it
341
342 (% element-id="1439" %)
343 if (!set.FileContent.Contains("<labaanlevering"))
344
345 (% element-id="1438" %)
346 {
347
348 (% element-id="1437" %)
349 set.FileContent = ZipStreamHelper.DecompressBase64StringToString(set.FileContent);
350
351 (% element-id="1436" %)
352 }
353
354 (% element-id="1435" %)
355 }
356
357
358 (% element-id="1432" %)
359 }
360
361 (% element-id="1431" %)
362 catch (Exception ex)
363
364 (% element-id="1430" %)
365 {
366
367 (% element-id="1429" %)
368 #region handle exception
369
370
371 (% element-id="1426" %)
372 set.Status = new BusinessEntities.LabRestService.GetProductsCall.ResponseStatus();
373
374 (% element-id="1425" %)
375 set.Status.StatusCode = ((int)ResultCodes.GeneralError).ToString();
376
377 (% element-id="1424" %)
378 set.Status.ErrorMessage = "Exception occurred in GetProducts (username: " + WebserviceUsername + ", password: " + WebservicePassword + ") with message: " + ex.Message;
379
380
381 (% element-id="1421" %)
382 ex.Data.Add("WebserviceUsername", WebserviceUsername);
383
384 (% element-id="1420" %)
385 ex.Data.Add("WebservicePassword", WebservicePassword);
386
387 (% element-id="1419" %)
388 ex.Data.Add("CustomerUsername", CustomerUsername);
389
390 (% element-id="1418" %)
391 ex.Data.Add("sikbVersion", sikbVersion);
392
393 (% element-id="1417" %)
394 ex.Data.Add("customerid", customerid);
395
396 (% element-id="1416" %)
397 ex.Data.Add("languageCode", languageCode);
398
399
400 (% element-id="1413" %)
401 ExceptionHandler.HandleException(ex);
402
403 (% element-id="1412" %)
404 #endregion
405
406 (% element-id="1411" %)
407 }
408
409
410 (% element-id="1408" %)
411 return set;
412
413 (% element-id="1407" %)
414 }
415 )))
416
417 (% element-id="1406" %)
418 (% element-id="1404" %)|(% element-id="1403" %)(% element-id="1402" %)
419 (((
420 (% element-id="1401" %)
421 POST https:~/~/<URL>/GetProducts HTTP/1.1
422
423 (% element-id="1400" %)
424 Content-Type: application/x-www-form-urlencoded
425
426 (% element-id="1399" %)
427 Host: 81.175.89.24
428
429 (% element-id="1398" %)
430 Content-Length: 179
431
432 (% element-id="1397" %)
433 Expect: 100-continue
434
435
436 (% element-id="1394" %)
437 userName=<webservice_username>&password=<Webservice_password>&customerUsername=<customer_username or token>&languageCode=nld&clientId=300&sikbVersion=13.5.0&useZip=True
438 )))
439
440 (% element-id="1393" %)
441 === (% element-id="1392" %)Response example(%%) ===
442
443 (% element-id="1391" %)
444 (% element-id="1389" %)|(% element-id="1388" %)(% element-id="1387" %)
445 (((
446 (% element-id="1386" %)
447 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
448
449 (% element-id="1385" %)
450 <Response>
451
452 (% element-id="1384" %)
453 <FileContent> {SIKB FILE in ZIPSTREAM BASE64 format}</FileContent>
454
455 (% element-id="1383" %)
456 <Status>
457
458 (% element-id="1382" %)
459 <StatusCode>1</StatusCode>
460
461 (% element-id="1381" %)
462 <StatusCodeDescription>OK</StatusCodeDescription>
463
464 (% element-id="1380" %)
465 <ErrorMessage></ErrorMessage>
466
467 (% element-id="1379" %)
468 </Status></Response>
469 )))
470
471 (% element-id="1378" %)
472 = (% element-id="1377" %)Useraccount Checkup.(%%) =
473
474 (% element-id="1374" %)
475 == (% element-id="1373" %)Solution/Design(%%) ==
476
477 (% element-id="1372" %)
478 With every call we will no longer send customer usernames and customer passwords. We want to use a fixed Machine 2 Machine username and password for TerraIndex. So we need to be able to quickly check whether the Customer username we want to use exists, and is bound to our TerraIndex fixed Machine 2 machine account.
479
480 (% element-id="1371" %)
481 WebserviceUsername (string),
482 WebservicePassword (string),
483 CustomerUsername (string)
484
485
486 (% element-id="1366" %)
487 Therefor we call a Webserice for ValidCredentials Check:
488
489
490 (% class="table-hover" element-id="1363" %)
491 (% element-id="1361" %)|(% element-id="1360" %)(% element-id="1359" %)**Action**|(% element-id="1358" %)(% element-id="1357" %)**TerraIndex**|(% element-id="1356" %) |(% element-id="1354" %)(% element-id="1353" %)**Laboratorium**|(% element-id="1352" %)(% element-id="1351" %)**Parameters/Message**|(% element-id="1350" %)(% element-id="1349" %)**Remarks**|(% element-id="1348" %)(% element-id="1347" %)**ResultCodes**
492 (% element-id="1346" %)|(% element-id="1345" %)1|(% element-id="1344" %)Sends a request to the function: ValidCredentials().|=(% element-id="1343" %)>|(% element-id="1342" %) |(% element-id="1340" %)WebserviceUsername (string),
493 WebservicePassword (string),
494 CustomerUsername (string)|(% element-id="1337" %)We want to skip the Password of the customer, and we use the WebserviceUsername + WebservicePassword for real authentication.|(% element-id="1336" %)
495 (% element-id="1334" %)|(% element-id="1333" %)2|(% element-id="1332" %) |(% element-id="1330" %) |(% element-id="1328" %)Receives the request and checks the combination of WebserviceUsername and WebservicePassword is Ok. Then checks the CustomerUsername is valid.|(% element-id="1327" %) |(% element-id="1325" %) |(% element-id="1323" %)
496 (% element-id="1321" %)|(% element-id="1320" %)3|(% element-id="1319" %) |(% element-id="1317" %)<=|(% element-id="1316" %)Sends back a Success of InvalidCredentials|(% element-id="1315" %)ResultCode (),
497 ErrorMessage (string),|(% element-id="1313" %) |(% element-id="1311" %)1 = Success,
498 2 = GeneralError,
499 3 = WrongSIKBVersion,
500 4 = InvalidCredentials,
501 5 = CustomerUsernameInvalid,
502 6 = CustomerUsernameNotValidForCustomerCode
503 7 = FileContentProblem,
504 8 = InvalidOrderId,
505 9 = OrderIdAlreadyApproved
506 10 = PDFNotAvailable
507
508 (% element-id="1301" %)
509 == (% element-id="1300" %)Check ValidCredentials (POST)(%%) ==
510
511 (% element-id="1299" %)
512 === (% element-id="1298" %)Request example(%%) ===
513
514 (% element-id="1297" %)
515 (% element-id="1295" %)|(% element-id="1294" %)(% element-id="1293" %)
516 (((
517 (% element-id="1292" %)
518 public ValidCredentialsCall.Response ValidCredentials(string WebserviceUsername, string WebservicePassword, string CustomerUsername, string customerid)
519
520 (% element-id="1291" %)
521 {
522
523 (% element-id="1290" %)
524 ValidCredentialsCall.Response set = new ValidCredentialsCall.Response();
525
526
527 (% element-id="1287" %)
528 try
529
530 (% element-id="1286" %)
531 {
532
533
534 (% element-id="1283" %)
535 var content = new FormUrlEncodedContent(new[]
536
537 (% element-id="1282" %)
538 {
539
540 (% element-id="1281" %)
541 new KeyValuePair<string, string>("userName", WebserviceUsername),
542
543 (% element-id="1280" %)
544 new KeyValuePair<string, string>("password", WebservicePassword),
545
546 (% element-id="1279" %)
547 ~/~/new KeyValuePair<string, string>("clientId", customerid),   ~/~/ Optional
548
549 (% element-id="1278" %)
550 new KeyValuePair<string, string>("customerUsername", CustomerUsername),
551
552 (% element-id="1277" %)
553 });
554
555
556 (% element-id="1274" %)
557 HttpResponseMessage response = _HttpClient.PostAsync(_HttpClient.BaseAddress + "/ValidCredentials", content).Result;
558
559 (% element-id="1273" %)
560 response.EnsureSuccessStatusCode();
561
562 (% element-id="1272" %)
563 string responseMessage = response.Content.ReadAsStringAsync().Result;
564
565
566 (% element-id="1269" %)
567 if (string.IsNullOrEmpty(responseMessage))
568
569 (% element-id="1268" %)
570 {
571
572 (% element-id="1267" %)
573 throw new Exception("Empty response from: [" + _HttpClient.BaseAddress + " / ValidCredentials" + "]");
574
575 (% element-id="1266" %)
576 }
577
578 (% element-id="1265" %)
579 using (var ms = new System.IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(responseMessage~)~)~)
580
581 (% element-id="1264" %)
582 {
583
584 (% element-id="1263" %)
585 XmlSerializer serializer = new XmlSerializer(typeof(ValidCredentialsCall.Response));
586
587 (% element-id="1262" %)
588 set = (ValidCredentialsCall.Response)serializer.Deserialize(ms);
589
590
591 (% element-id="1259" %)
592 return set;
593
594 (% element-id="1258" %)
595 }
596
597
598 (% element-id="1255" %)
599 }
600
601 (% element-id="1254" %)
602 catch (Exception ex)
603
604 (% element-id="1253" %)
605 {
606
607 (% element-id="1252" %)
608 #region handle exception
609
610
611 (% element-id="1249" %)
612 set.Status = new BusinessEntities.LabRestService.ValidCredentialsCall.ResponseStatus();
613
614 (% element-id="1248" %)
615 set.Status.StatusCode = ((int)ResultCodes.GeneralError).ToString();
616
617 (% element-id="1247" %)
618 set.Status.ErrorMessage = "Exception occurred in GetValidCredentials (username: " + WebserviceUsername + ", with message: " + ex.Message;
619
620
621 (% element-id="1244" %)
622 ex.Data.Add("WebserviceUsername", WebserviceUsername);
623
624 (% element-id="1243" %)
625 ex.Data.Add("WebservicePassword", WebservicePassword);
626
627 (% element-id="1242" %)
628 ex.Data.Add("CustomerUsername", CustomerUsername);
629
630
631 (% element-id="1239" %)
632 ExceptionHandler.HandleException(ex);
633
634 (% element-id="1238" %)
635 #endregion
636
637 (% element-id="1237" %)
638 }
639
640
641 (% element-id="1234" %)
642 return set;
643
644 (% element-id="1233" %)
645 }
646 )))
647
648 (% element-id="1232" %)
649 (% element-id="1230" %)|(% element-id="1229" %)(% element-id="1228" %)
650 (((
651 (% element-id="1227" %)
652 POST https:~/~/<URL>/ValidCredentials HTTP/1.1
653
654 (% element-id="1226" %)
655 Content-Type: application/x-www-form-urlencoded
656
657 (% element-id="1225" %)
658 Host: 81.175.89.24
659
660 (% element-id="1224" %)
661 Content-Length: 125
662
663 (% element-id="1223" %)
664 Expect: 100-continue
665
666
667 (% element-id="1220" %)
668 userName=<webservice_username>&password=<Webservice_password>&clientId=<optional otherwise empty>&customerUsername=<customer_username or token>
669 )))
670
671 (% element-id="1219" %)
672 === (% element-id="1218" %)Response example(%%) ===
673
674 (% element-id="1217" %)
675 (% element-id="1215" %)|(% element-id="1214" %)(% element-id="1213" %)
676 (((
677 (% element-id="1212" %)
678 <?xml version="1.0" encoding="UTF-8" standalone="no"?><Response>
679
680 (% element-id="1211" %)
681 <Status>
682
683 (% element-id="1210" %)
684 <StatusCode>1</StatusCode>
685
686 (% element-id="1209" %)
687 <StatusCodeDescription>OK</StatusCodeDescription>
688
689 (% element-id="1208" %)
690 <ErrorMessage></ErrorMessage>
691
692 (% element-id="1207" %)
693 </Status>
694
695 (% element-id="1206" %)
696 </Response>
697 )))
698
699 (% element-id="1205" %)
700 = (% element-id="1204" %)Labassignment request delivery(POST)(%%) =
701
702 (% element-id="1203" %)
703 == (% element-id="1202" %)Solution/Design(%%) ==
704
705 (% element-id="1201" %)
706 For this we create a Webserice for CreateOrder to create the order in the lab system.
707 After the creation, we would like to show an order overview of the laboratory in the future in PDF. The user can see the prices and can confirm or cancel.
708 Depending on the user's choice at the laboratory, to support this or not, TerraIndex calls the ApproveOrder or the CancelOrder.
709
710 (% element-id="0" %)
711 For default we assume that we cannot do this yet, and TerraIndex sends needsApprovalIsSupported = false. If this becomes true in the future, the Lab can indicate whether or not it is necessary in the NeedsApprove field.
712
713
714 (% class="table-hover" element-id="1195" %)
715 (% element-id="1193" %)|(% element-id="1192" %)(% element-id="1191" %)**Action**|(% element-id="1190" %)(% element-id="1189" %)**TerraIndex**|(% element-id="1188" %) |(% element-id="1186" %)(% element-id="1185" %)**Laboratorium**|(% element-id="1184" %)(% element-id="1183" %)**Parameters/Message**|(% element-id="1182" %)(% element-id="1181" %)**Remarks**|(% element-id="1180" %)(% element-id="1179" %)**ResultCodes**
716 (% element-id="1178" %)|(% element-id="1177" %)1|(% element-id="1176" %)Sends a request to the function: CreateOrder().|=(% element-id="1175" %)>|(% element-id="1174" %) |(% element-id="1172" %)WebserviceUsername (string),
717 WebservicePassword (string),
718 CustomerUsername (string),
719 FileContent_Base64 (string),
720 UseZipStream/UseZip (bool, default: 'false'),
721 CustomerCode (string),
722 SIKBVersion (string, default: '13.4.0'),
723 needsApprovalIsSupported (bool)|(% element-id="1164" %)SIKB Version included, so labs can quickly check the version.
724 Besides SIKB 13.4.0, TerraIndex also supports 9.0.0.
725 \\Before sending the SIKB, validate to the XSD!
726 And to the XSLT?
727 \\needsApprovalIsSupported = false; means we dont get PDF with offerte. This will make is faster.
728 needsApprovalIsSupported = true; means lab will check the user setting to send a PDF Offerte back or not. (If the lab can support this.)|(% element-id="1156" %)
729 (% element-id="1154" %)|(% element-id="1153" %)2|(% element-id="1152" %) |(% element-id="1150" %) |(% element-id="1148" %)Receives the request and checks the credentials.|(% element-id="1147" %) |(% element-id="1145" %) |(% element-id="1143" %)
730 (% element-id="1141" %)|(% colspan="1" element-id="1140" %)3|(% colspan="1" element-id="1139" %) |(% colspan="1" element-id="1137" %) |(% colspan="1" element-id="1135" %)Credentials are valid, the Filecontent is checked on a valid Labassignment. When valid it will be processed and a OrderId is given.|(% colspan="1" element-id="1134" %) |(% colspan="1" element-id="1132" %)Laboratorium saves the Sample GUIDs if it's SIKB 13 or higher.
731 Otherwise we use the idanlmons unique ID.|(% colspan="1" element-id="1130" %)
732 (% element-id="1128" %)|(% colspan="1" element-id="1127" %) |(% colspan="1" element-id="1125" %) |(% colspan="1" element-id="1123" %) |(% colspan="1" element-id="1121" %)Based on what customer, the order will be approved or the approve needs to be done in laboratorium system.|(% colspan="1" element-id="1120" %) |(% colspan="1" element-id="1118" %) |(% colspan="1" element-id="1116" %)
733 (% element-id="1114" %)|(% element-id="1113" %)4|(% element-id="1112" %) |(% element-id="1110" %)<=|(% element-id="1109" %)Sends back a Success with the new OrderId|(% element-id="1108" %)ResultCode (),
734 ErrorMessage (string),
735 OrderId (string),
736 NeedsApprove (bool),
737 FileContent_Base64 (string),
738 UseZipStream/UseZip (bool, default: 'false'),|(% element-id="1102" %)In the future labs will send back the PDF with the prices and some checks. To approve or cancel. For the first version this is not required yet and the fileContent remains empty.|(% element-id="1101" %)1 = Success,
739 2 = GeneralError,
740 3 = WrongSIKBVersion,
741 4 = InvalidCredentials,
742 5 = CustomerUsernameInvalid,
743 6 = CustomerUsernameNotValidForCustomerCode
744 7 = FileContentProblem,
745 8 = InvalidOrderId,
746 9 = OrderIdAlreadyApproved
747 10 = PDFNotAvailable
748 (% element-id="1091" %)|(% colspan="1" element-id="1090" %)6|(% colspan="1" element-id="1089" %)Receives the OrderId, and saves it.
749 |(% colspan="1" element-id="1086" %) |(% colspan="1" element-id="1084" %) |(% colspan="1" element-id="1082" %) |(% colspan="1" element-id="1080" %)(% element-id="1079" %)
750 (((
751 (% element-id="1078" %)
752 Default for now laboratorium will send:
753 NeedsApprove = False,
754 PDF = Empty,
755 Zipstream = False,
756
757
758 (% element-id="1072" %)
759 In the future, do something with the PDF and show the PDF to users to Approve or Cancel.
760 This will be done by; NeedsApprove = true.
761 \\If NeedsApprove is False, the order is Processed and can't be changed in TI. Like it is now.
762
763 (% element-id="1068" %)
764
765 )))|(% colspan="1" element-id="1066" %)
766 (% element-id="1064" %)|(% colspan="1" element-id="1063" %) |(% colspan="1" element-id="1061" %) |(% colspan="1" element-id="1059" %) |(% colspan="1" element-id="1057" %) |(% colspan="1" element-id="1055" %) |(% colspan="1" element-id="1053" %) |(% colspan="1" element-id="1051" %)
767 (% element-id="1049" %)|(% colspan="1" element-id="1048" %) |(% colspan="1" element-id="1046" %) |(% colspan="1" element-id="1044" %) |(% colspan="1" element-id="1042" %) |(% colspan="1" element-id="1040" %) |(% colspan="1" element-id="1038" %) |(% colspan="1" element-id="1036" %)
768 (% element-id="1034" %)|(% colspan="1" element-id="1033" %) |(% colspan="1" element-id="1031" %)(% element-id="1030" %)**IN THE FUTURE: APPROVEORDER**|(% colspan="1" element-id="1029" %) |(% colspan="1" element-id="1027" %) |(% colspan="1" element-id="1025" %) |(% colspan="1" element-id="1023" %) |(% colspan="1" element-id="1021" %)
769 (% element-id="1019" %)|(% colspan="1" element-id="1018" %)7|(% colspan="1" element-id="1017" %)Sends a request to the function: ApproveOrder().|(% colspan="1" element-id="1016" %)=>|(% colspan="1" element-id="1015" %) |(% colspan="1" element-id="1013" %)WebserviceUsername (string),
770 WebservicePassword (string),
771 CustomerUsername (string),
772 OrderId (string)|(% colspan="1" element-id="1009" %) |(% colspan="1" element-id="1007" %)
773 (% element-id="1005" %)|(% colspan="1" element-id="1004" %)8|(% colspan="1" element-id="1003" %) |(% colspan="1" element-id="1001" %) |(% colspan="1" element-id="999" %)Receives the approve and checks the credentials and the OrderId.|(% colspan="1" element-id="998" %) |(% colspan="1" element-id="996" %) |(% colspan="1" element-id="994" %)
774 (% element-id="992" %)|(% colspan="1" element-id="991" %)9|(% colspan="1" element-id="990" %) |(% colspan="1" element-id="988" %)<=|(% colspan="1" element-id="987" %)Sends back a Success with the new CertificateNr|(% colspan="1" element-id="986" %)ResultCode (),
775 ErrorMessage (string),
776 CertificateNr (string)|(% colspan="1" element-id="983" %)This process takes too long at some labs. Maybe this won't be workable...so maybe the CertificateNr return won't be possible. In this case, leave the CertificateNr empty. TerraIndex will read it from GetOrderStatus calls.|(% colspan="1" element-id="982" %)1 = Success,
777 2 = GeneralError,
778 3 = WrongSIKBVersion,
779 4 = InvalidCredentials,
780 5 = CustomerUsernameInvalid,
781 6 = CustomerUsernameNotValidForCustomerCode
782 7 = FileContentProblem,
783 8 = InvalidOrderId,
784 9 = OrderIdAlreadyApproved
785 10 = PDFNotAvailable
786 (% element-id="972" %)|(% colspan="1" element-id="971" %)10|(% colspan="1" element-id="970" %)Receives the CerificateNr and saves it.|(% colspan="1" element-id="969" %) |(% colspan="1" element-id="967" %) |(% colspan="1" element-id="965" %) |(% colspan="1" element-id="963" %) |(% colspan="1" element-id="961" %)
787 (% element-id="959" %)|(% colspan="1" element-id="958" %) |(% colspan="1" element-id="956" %) |(% colspan="1" element-id="954" %) |(% colspan="1" element-id="952" %) |(% colspan="1" element-id="950" %) |(% colspan="1" element-id="948" %) |(% colspan="1" element-id="946" %)
788 (% element-id="944" %)|(% colspan="1" element-id="943" %) |(% colspan="1" element-id="941" %)(% element-id="940" %)**IN THE FUTURE: CANCELORDER**|(% colspan="1" element-id="939" %) |(% colspan="1" element-id="937" %) |(% colspan="1" element-id="935" %) |(% colspan="1" element-id="933" %) |(% colspan="1" element-id="931" %)
789 (% element-id="929" %)|(% element-id="928" %)7|(% element-id="927" %)Sends a request to the function: CancelOrder().|=(% element-id="926" %)>|(% element-id="925" %) |(% element-id="923" %)WebserviceUsername (string),
790 WebservicePassword (string),
791 CustomerUsername (string),
792 OrderId (string)|(% element-id="919" %) |(% element-id="917" %)
793 (% element-id="915" %)|(% element-id="914" %)8|(% element-id="913" %) |(% element-id="911" %) |(% element-id="909" %)Receives the cancel and checks the credentials and the OrderId.|(% element-id="908" %) |(% element-id="906" %) |(% element-id="904" %)
794 (% element-id="902" %)|(% element-id="901" %)9|(% element-id="900" %) |(% element-id="898" %)<=|(% element-id="897" %)Sends back a Success |(% element-id="896" %)ResultCode (),
795 ErrorMessage (string)|(% element-id="894" %) |(% element-id="892" %)1 = Success,
796 2 = GeneralError,
797 3 = WrongSIKBVersion,
798 4 = InvalidCredentials,
799 5 = CustomerUsernameInvalid,
800 6 = CustomerUsernameNotValidForCustomerCode
801 7 = FileContentProblem,
802 8 = InvalidOrderId,
803 9 = OrderIdAlreadyApproved
804 10 = PDFNotAvailable
805 (% element-id="882" %)|(% element-id="881" %)10|(% element-id="880" %)Removes the OrderId and the IsSend to False|(% element-id="879" %) |(% element-id="877" %) |(% element-id="875" %) |(% element-id="873" %)If OrderIsAleadyApproved, set the values to Approved and keep the OrderId and IsSend.|(% element-id="872" %)
806 (% element-id="870" %)|(% colspan="1" element-id="869" %) |(% colspan="1" element-id="867" %) |(% colspan="1" element-id="865" %) |(% colspan="1" element-id="863" %) |(% colspan="1" element-id="861" %) |(% colspan="1" element-id="859" %) |(% colspan="1" element-id="857" %)
807
808 (% element-id="855" %)
809 == (% element-id="854" %)Create Order(%%) ==
810
811 (% element-id="853" %)
812 === (% element-id="852" %)Request example(%%) ===
813
814 (% element-id="851" %)
815 (% element-id="849" %)|(% element-id="848" %)(% element-id="847" %)
816 (((
817 (% element-id="846" %)
818 public CreateOrderResponse.Response SendLabAssignment(string WebserviceUsername, string WebservicePassword, string CustomerUsername, string customerid, string sikbVersion, string assignmentXML, string languageCode, bool needsApprovalIsSupported = false)
819
820 (% element-id="845" %)
821 {
822
823 (% element-id="844" %)
824 CreateOrderResponse.Response set = new CreateOrderResponse.Response();
825
826
827 (% element-id="841" %)
828 try
829
830 (% element-id="840" %)
831 {
832
833 (% element-id="839" %)
834 bool useZipstream = true;
835
836
837 (% element-id="836" %)
838 MultipartFormDataContent content = new MultipartFormDataContent();
839
840
841 (% element-id="833" %)
842 ~/~/Add Formdata
843
844 (% element-id="832" %)
845 var formDataDictionary = new[]
846
847 (% element-id="831" %)
848 {
849
850 (% element-id="830" %)
851 new KeyValuePair<string, string>("userName", WebserviceUsername),
852
853 (% element-id="829" %)
854 new KeyValuePair<string, string>("password", WebservicePassword),
855
856 (% element-id="828" %)
857 new KeyValuePair<string, string>("customerUserName", CustomerUsername),
858
859 (% element-id="827" %)
860 new KeyValuePair<string, string>("clientId", customerid),
861
862 (% element-id="826" %)
863 new KeyValuePair<string, string>("sikbVersion", sikbVersion),
864
865 (% element-id="825" %)
866 new KeyValuePair<string, string>("languageCode", languageCode),
867
868 (% element-id="824" %)
869 new KeyValuePair<string, string>("useZip", useZipstream.ToString() ),
870
871 (% element-id="823" %)
872 new KeyValuePair<string, string>("needsApprovalIsSupported", needsApprovalIsSupported.ToString() ),
873
874 (% element-id="822" %)
875 ~/~/new KeyValuePair<string, string>("orderXml", ZipStreamHelper.CompressToBase64String(assignmentXML)),
876
877 (% element-id="821" %)
878 ~/~/new KeyValuePair<string, string>("orderXml", assignmentXML),
879
880 (% element-id="820" %)
881 };              
882
883 (% element-id="819" %)
884 foreach (var item in formDataDictionary)
885
886 (% element-id="818" %)
887 {
888
889 (% element-id="817" %)
890 content.Add(new StringContent(item.Value), $"\"{item.Key}\"");
891
892 (% element-id="816" %)
893 }
894
895
896 (% element-id="813" %)
897 string filexml = string.Empty;
898
899 (% element-id="812" %)
900 if (useZipstream)
901
902 (% element-id="811" %)
903 {
904
905 (% element-id="810" %)
906 filexml = ZipStreamHelper.CompressToBase64String(assignmentXML);
907
908 (% element-id="809" %)
909 }
910
911 (% element-id="808" %)
912 else
913
914 (% element-id="807" %)
915 {
916
917 (% element-id="806" %)
918 filexml = assignmentXML;
919
920 (% element-id="805" %)
921 }
922
923
924 (% element-id="802" %)
925 ~/~/Add filecontent
926
927 (% element-id="801" %)
928 var fileContent = new ByteArrayContent(ZipStreamHelper.stringToByteArray(filexml));
929
930 (% element-id="800" %)
931 fileContent.Headers.ContentDisposition =
932
933 (% element-id="799" %)
934 new System.Net.Http.Headers.ContentDispositionHeaderValue("form-data") ~/~/<- 'form-data' instead of 'attachment'
935
936 (% element-id="798" %)
937 {
938
939 (% element-id="797" %)
940 Name = "\"orderXml\"", ~/~/ \" is needed so the message contains the quotes, wihtout it will fail
941
942 (% element-id="796" %)
943 FileName = "\"VivaTerraIndexAssignment.xml\""
944
945 (% element-id="795" %)
946 };
947
948 (% element-id="794" %)
949 fileContent.Headers.ContentType = MediaTypeHeaderValue.Parse("application/xml");              
950
951 (% element-id="793" %)
952 content.Add(fileContent);
953
954
955 (% element-id="790" %)
956 ~/~/Start sending
957
958
959 (% element-id="787" %)
960 HttpResponseMessage response = _HttpClient.PostAsync(_HttpClient.BaseAddress + "/CreateOrder", content).Result;
961
962 (% element-id="786" %)
963 response.EnsureSuccessStatusCode();
964
965 (% element-id="785" %)
966 string responseMessage = response.Content.ReadAsStringAsync().Result;
967
968
969 (% element-id="782" %)
970 if (string.IsNullOrEmpty(responseMessage))
971
972 (% element-id="781" %)
973 {
974
975 (% element-id="780" %)
976 throw new Exception("Empty response from: [" + _HttpClient.BaseAddress + " /CreateOrder" + "]");
977
978 (% element-id="779" %)
979 }
980
981 (% element-id="778" %)
982 using (var ms = new System.IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(responseMessage~)~)~)
983
984 (% element-id="777" %)
985 {
986
987 (% element-id="776" %)
988 XmlSerializer serializer = new XmlSerializer(typeof(CreateOrderResponse.Response));
989
990 (% element-id="775" %)
991 set = (CreateOrderResponse.Response)serializer.Deserialize(ms);
992
993 (% element-id="774" %)
994 }
995
996
997 (% element-id="771" %)
998 ~/~/Can contain a PDf with price information
999
1000 (% element-id="770" %)
1001 if (set.UseZip && !string.IsNullOrEmpty(set.FileContent))
1002
1003 (% element-id="769" %)
1004 {
1005
1006 (% element-id="768" %)
1007 ~/~/convert from base64 string back to normal
1008
1009 (% element-id="767" %)
1010 set.FileContent = ZipStreamHelper.DecompressBase64StringToString(set.FileContent);                  
1011
1012 (% element-id="766" %)
1013 }
1014
1015
1016 (% element-id="763" %)
1017 }
1018
1019 (% element-id="762" %)
1020 catch (Exception ex)
1021
1022 (% element-id="761" %)
1023 {
1024
1025 (% element-id="760" %)
1026 #region handle exception
1027
1028
1029 (% element-id="757" %)
1030 set.Status = new BusinessEntities.LabRestService.CreateOrderResponse.ResponseStatus();
1031
1032 (% element-id="756" %)
1033 set.Status.StatusCode = ((int)ResultCodes.GeneralError).ToString();
1034
1035 (% element-id="755" %)
1036 set.Status.ErrorMessage = "Exception occurred in CreateOrder (username: " + WebserviceUsername + ") with message: " + ex.Message;
1037
1038
1039 (% element-id="752" %)
1040 ex.Data.Add("WebserviceUsername", WebserviceUsername);
1041
1042 (% element-id="751" %)
1043 ex.Data.Add("WebservicePassword", WebservicePassword);
1044
1045 (% element-id="750" %)
1046 ex.Data.Add("CustomerUsername", CustomerUsername);
1047
1048 (% element-id="749" %)
1049 ex.Data.Add("sikbVersion", sikbVersion);
1050
1051 (% element-id="748" %)
1052 ex.Data.Add("customerid", customerid);
1053
1054
1055 (% element-id="745" %)
1056 ExceptionHandler.HandleException(ex);
1057
1058 (% element-id="744" %)
1059 #endregion
1060
1061 (% element-id="743" %)
1062 }
1063
1064
1065 (% element-id="740" %)
1066 return set;
1067
1068 (% element-id="739" %)
1069 }
1070 )))
1071
1072 (% element-id="738" %)
1073 (% element-id="736" %)|(% element-id="735" %)(% element-id="734" %)
1074 (((
1075 (% element-id="733" %)
1076 POST https:~/~/<URL>/CreateOrder HTTP/1.1
1077
1078 (% element-id="732" %)
1079 Content-Type: multipart/form-data; boundary="28a3e130-70c9-4a1a-b544-a802a1ade6ca"
1080
1081 (% element-id="731" %)
1082 Host: 81.175.89.24
1083
1084 (% element-id="730" %)
1085 Content-Length: 5010
1086
1087 (% element-id="729" %)
1088 Expect: 100-continue
1089
1090
1091 (% element-id="726" %)
1092 ~-~-28a3e130-70c9-4a1a-b544-a802a1ade6ca
1093
1094 (% element-id="725" %)
1095 Content-Type: text/plain; charset=utf-8
1096
1097 (% element-id="724" %)
1098 Content-Disposition: form-data; name="userName"
1099
1100
1101 (% element-id="721" %)
1102 <Webservice_Username>
1103
1104 (% element-id="720" %)
1105 ~-~-28a3e130-70c9-4a1a-b544-a802a1ade6ca
1106
1107 (% element-id="719" %)
1108 Content-Type: text/plain; charset=utf-8
1109
1110 (% element-id="718" %)
1111 Content-Disposition: form-data; name="password"
1112
1113
1114 (% element-id="715" %)
1115 <Webservice_Password>
1116
1117 (% element-id="714" %)
1118 ~-~-28a3e130-70c9-4a1a-b544-a802a1ade6ca
1119
1120 (% element-id="713" %)
1121 Content-Type: text/plain; charset=utf-8
1122
1123 (% element-id="712" %)
1124 Content-Disposition: form-data; name="customerUserName"
1125
1126
1127 (% element-id="709" %)
1128 <Customer_Username or token>
1129
1130 (% element-id="708" %)
1131 ~-~-28a3e130-70c9-4a1a-b544-a802a1ade6ca
1132
1133 (% element-id="707" %)
1134 Content-Type: text/plain; charset=utf-8
1135
1136 (% element-id="706" %)
1137 Content-Disposition: form-data; name="clientId"
1138
1139
1140 (% element-id="703" %)
1141 300
1142
1143 (% element-id="702" %)
1144 ~-~-28a3e130-70c9-4a1a-b544-a802a1ade6ca
1145
1146 (% element-id="701" %)
1147 Content-Type: text/plain; charset=utf-8
1148
1149 (% element-id="700" %)
1150 Content-Disposition: form-data; name="sikbVersion"
1151
1152
1153 (% element-id="697" %)
1154 13.4.0
1155
1156 (% element-id="696" %)
1157 ~-~-28a3e130-70c9-4a1a-b544-a802a1ade6ca
1158
1159 (% element-id="695" %)
1160 Content-Type: text/plain; charset=utf-8
1161
1162 (% element-id="694" %)
1163 Content-Disposition: form-data; name="languageCode"
1164
1165
1166 (% element-id="691" %)
1167 nld
1168
1169 (% element-id="690" %)
1170 ~-~-28a3e130-70c9-4a1a-b544-a802a1ade6ca
1171
1172 (% element-id="689" %)
1173 Content-Type: text/plain; charset=utf-8
1174
1175 (% element-id="688" %)
1176 Content-Disposition: form-data; name="useZip"
1177
1178
1179 (% element-id="685" %)
1180 True
1181
1182 (% element-id="684" %)
1183 ~-~-28a3e130-70c9-4a1a-b544-a802a1ade6ca
1184
1185 (% element-id="683" %)
1186 Content-Type: text/plain; charset=utf-8
1187
1188 (% element-id="682" %)
1189 Content-Disposition: form-data; name="needsApprovalIsSupported"
1190
1191
1192 (% element-id="679" %)
1193 False
1194
1195 (% element-id="678" %)
1196 ~-~-28a3e130-70c9-4a1a-b544-a802a1ade6ca
1197
1198 (% element-id="677" %)
1199 Content-Disposition: form-data; name="orderXml"; filename="VivaTerraIndexAssignment.xml"
1200
1201 (% element-id="676" %)
1202 Content-Type: application/xml
1203
1204
1205 (% element-id="673" %)
1206 <SIKB File in Zip stream Base64  encoding>
1207
1208 (% element-id="672" %)
1209 ~-~-28a3e130-70c9-4a1a-b544-a802a1ade6ca~-~-
1210 )))
1211
1212 (% element-id="671" %)
1213 === (% element-id="670" %)Response example(%%) ===
1214
1215 (% element-id="669" %)
1216 (% element-id="667" %)|(% element-id="666" %)(% element-id="665" %)
1217 (((
1218 (% element-id="664" %)
1219 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1220
1221 (% element-id="663" %)
1222 <Response>
1223
1224 (% element-id="662" %)
1225 <OrderId>7113828</OrderId>
1226
1227 (% element-id="661" %)
1228 <NeedsApproval>True</NeedsApproval>
1229
1230 (% element-id="660" %)
1231 <FileContent></FileContent>
1232
1233 (% element-id="659" %)
1234 <Status>
1235
1236 (% element-id="658" %)
1237 <StatusCode>1</StatusCode>
1238
1239 (% element-id="657" %)
1240 <StatusCodeDescription>OK</StatusCodeDescription>
1241
1242 (% element-id="656" %)
1243 <ErrorMessage></ErrorMessage>
1244
1245 (% element-id="655" %)
1246 </Status></Response>
1247 )))
1248
1249 (% element-id="654" %)
1250 = (% element-id="653" %)Get Order status and Results(%%) =
1251
1252 (% element-id="652" %)
1253 == (% element-id="651" %)Solution/Design(%%) ==
1254
1255 (% element-id="650" %)
1256 TerraIndex will request per license/customer which results are ready. These are queried if the latest changes are newer than the last check. This way we never download too much unnecessarily and it can always be requested again.
1257
1258 (% class="table-hover" element-id="647" %)
1259 (% element-id="645" %)|(% element-id="644" %)Action|(% element-id="643" %)TerraIndex|(% element-id="642" %) |(% element-id="640" %)Laboratorium|(% element-id="639" %)Parameters/Message|(% element-id="638" %)Remarks|(% element-id="637" %)ResultCodes
1260 (% element-id="636" %)|(% element-id="635" %)1|(% element-id="634" %)Sends a request to the function: GetCustomers().|=(% element-id="633" %)>|(% element-id="632" %) |(% element-id="630" %)WebserviceUsername (string), 
1261 WebservicePassword (string),
1262 CustomerUsername (string)|(% element-id="627" %)We want to skip the Password of the customer, and we introduce the WebserviceUsername + WebservicePassword.|(% element-id="626" %)
1263 (% element-id="624" %)|(% element-id="623" %)2|(% element-id="622" %) |(% element-id="620" %) |(% element-id="618" %)Receives the request and check the customers this username and searches the dateLastChanged for this Customer.|(% element-id="617" %) |(% element-id="615" %) |(% element-id="613" %)
1264 (% element-id="611" %)|(% element-id="610" %)3|(% element-id="609" %) |(% element-id="607" %)<=|(% element-id="606" %)Sends back the list of customers with the lastChangedTimestamp|(% element-id="605" %)ResultCode (),
1265 ErrorMessage (string),
1266 List<customer> , Customer:
1267 CustomerCode (string),
1268 CustomerName (string),
1269 LabID (int),
1270 LabName (string),
1271 ChangedTimeStamp (DateTime)|(% element-id="597" %)We receive the dateTimestamp instead of sending it, so we always get the full list and we are also able to delete customercodes.|(% element-id="596" %)1 = Success,
1272 2 = GeneralError,
1273 3 = WrongSIKBVersion,
1274 4 = InvalidCredentials,
1275 5 = CustomerUsernameInvalid,
1276 6 = CustomerUsernameNotValidForCustomerCode
1277 7 = FileContentProblem,
1278 8 = InvalidOrderId,
1279 9 = OrderIdAlreadyApproved
1280 10 = PDFNotAvailable
1281 (% element-id="586" %)|(% element-id="585" %)4|(% element-id="584" %)Receives the list of Customers. Read the Timestamp this Customer is last checked for Results/Statuses.|(% element-id="583" %) |(% element-id="581" %) |(% element-id="579" %) |(% element-id="577" %) |(% element-id="575" %)
1282 (% element-id="573" %)|(% element-id="572" %)5|(% element-id="571" %)Send for each Customer a  call to retreive all orders statuses changes since a certain timestamp.
1283 Function: GetOrderStatuses()|=(% element-id="569" %)>|(% element-id="568" %) |(% element-id="566" %)WebserviceUsername (string), 
1284 WebservicePassword (string),
1285 CustomerUsername (string),
1286 CustomerCode (string),
1287 LastCheckedTimestamp (DateTime)|(% element-id="561" %)TerraIndex keeps track of the last check timestamp for each license.|(% element-id="560" %)
1288 (% element-id="558" %)|(% element-id="557" %)6|(% element-id="556" %) |(% element-id="554" %) |(% element-id="552" %)Receives the request and check the orders that are changed since the timestamp for this Customer.|(% element-id="551" %) |(% element-id="549" %) |(% element-id="547" %)
1289 (% element-id="545" %)|(% element-id="544" %)7|(% element-id="543" %) |(% element-id="541" %)<=|(% element-id="540" %)Sends back the list of orders with the status and lastChangedTimestamp|(% element-id="539" %)ResultCode (),
1290 ErrorMessage (string),
1291 OrderID (string),
1292 LabassignmentGUID (GUID),
1293 CertificateNumber (string)
1294 OrderStatusSIKB (int),
1295 Delayed (boolean),
1296 ExpectedTimeStamp (DateTime),|(% element-id="531" %)OrderStatusSIKB is the SIKB Labassignment status.
1297 \\Delayed is a boolean to tell the customer a order will be later ready then expected. The ExpectedTimestamp.
1298 If Delayed for the firsttime, TerraIndex can send a notification to the users and show a different layout.
1299 \\LabassignmentGUID is filled to support also Labassignments that are not from TerraIndex Ordered.|(% element-id="525" %)1 = Success,
1300 2 = GeneralError,
1301 3 = WrongSIKBVersion,
1302 4 = InvalidCredentials,
1303 5 = CustomerUsernameInvalid,
1304 6 = CustomerUsernameNotValidForCustomerCode
1305 7 = FileContentProblem,
1306 8 = InvalidOrderId,
1307 9 = OrderIdAlreadyApproved
1308 10 = PDFNotAvailable
1309 (% element-id="515" %)|(% element-id="514" %)8|(% element-id="513" %)Receives the list of Orders with status.
1310 Update the CertificateNr if this is not already present in the labassignment. |(% element-id="511" %) |(% element-id="509" %) |(% element-id="507" %) |(% element-id="505" %)CertifcateNumber could be new here, if the lab wasn't able to fill it directly at the ApproveOrder.|(% element-id="504" %)
1311 (% element-id="502" %)|(% element-id="501" %)9|(% element-id="500" %)Send for each Order a call to retreive all results.
1312 Function: GetOrderResults()|=(% element-id="498" %)>|(% element-id="497" %) |(% element-id="495" %)WebserviceUsername (string), 
1313 WebservicePassword (string),
1314 CustomerUsername (string),
1315 CustomerCode (string),
1316 OrderID (string),
1317 SIKBVersion (string, default: '13.4.0')|(% element-id="489" %)Besides SIKB 13.4.0, TerraIndex also supports 9.0.0/8.0.0 etc.|(% element-id="488" %)
1318 (% element-id="486" %)|(% element-id="485" %)10|(% element-id="484" %) |(% element-id="482" %) |(% element-id="480" %)Receives the request and creates a SIKB results file based on the version that is requested.|(% element-id="479" %) |(% element-id="477" %) |(% element-id="475" %)
1319 (% element-id="473" %)|(% element-id="472" %)11|(% element-id="471" %) |(% element-id="469" %)<=|(% element-id="468" %)Sends back the results of the orders.|(% element-id="467" %)ResultCode (),
1320 ErrorMessage (string),
1321 OrderId (string),
1322 LabassignmentGUID (GUID),
1323 FileContent_Base64 (string),
1324 UseZipStream/UseZip (bool, default: 'false'),|(% element-id="461" %) |(% element-id="459" %)1 = Success,
1325 2 = GeneralError,
1326 3 = WrongSIKBVersion,
1327 4 = InvalidCredentials,
1328 5 = CustomerUsernameInvalid,
1329 6 = CustomerUsernameNotValidForCustomerCode
1330 7 = FileContentProblem,
1331 8 = InvalidOrderId,
1332 9 = OrderIdAlreadyApproved
1333 10 = PDFNotAvailable
1334 (% element-id="449" %)|(% element-id="448" %)12|(% element-id="447" %)Receives the results and imports all results.|(% element-id="446" %) |(% element-id="444" %) |(% element-id="442" %) |(% element-id="440" %)(% element-id="439" %)
1335 (((
1336 (% element-id="438" %)
1337 Import will be done to corresponding samples based on:
1338
1339 (% element-id="437" %)
1340 * Find Project by ProjectGUID (as provided in the labassignment)
1341 * Find Project by ProjectCode (as provided in the Labassignment)
1342 * Find Project and Labassignment by LabassignmentGUID (as provided in the Labassignment)
1343 * Find Project (only if Project is not found yet) and Samples based on SampleGUID (as provided in the Labassignment) .
1344 Sample GUIDs that are send to the lab in the labassignment version SIKB 13 or higher are required in the results for labassignment.
1345 For lower version Labassignments the lab should return the 'old' idanlmons as SampleGUID in the XML.
1346 * Find Samples (only if Project is already found ) by SampleName
1347
1348 (% element-id="429" %)
1349 What is imported?
1350
1351 (% element-id="428" %)
1352 * If Sample is found, the results in the XML are always all updated and/or inserted.
1353 * If Project is found, but the sample is not; The Sample and the results are inserted as new Sample. (If watersample; fake filtertube and fake measurementpoints are created)
1354 )))|(% element-id="425" %)
1355 (% element-id="423" %)|(% element-id="422" %)13|(% element-id="421" %)If OrderStatus is 'Completed/Reported' (SIKBID: 5)
1356 Request the PDF certificate.
1357 Function: GetOrderPDF()|=(% element-id="418" %)>|(% element-id="417" %) |(% element-id="415" %)WebserviceUsername (string), 
1358 WebservicePassword (string),
1359 CustomerUsername (string),
1360 CustomerCode (string),
1361 OrderID (string),|(% element-id="410" %) |(% element-id="408" %)
1362 (% element-id="406" %)|(% element-id="405" %)14|(% element-id="404" %) |(% element-id="402" %) |(% element-id="400" %)Receives the request and creates the PDF for the Order.|(% element-id="399" %) |(% element-id="397" %) |(% element-id="395" %)
1363 (% element-id="393" %)|(% element-id="392" %)15|(% element-id="391" %) |(% element-id="389" %)<=|(% element-id="388" %)Sends back the PDF of the order.|(% element-id="387" %)ResultCode (),
1364 ErrorMessage (string),
1365 OrderId (string),
1366 LabassignmentGUID (GUID),
1367 FileContent_Base64 (string),
1368 UseZipStream/UseZip (bool, default: 'false'),|(% element-id="381" %)If the PDF is not available yet, please give the resultcode: PDFNotAvailable.|(% element-id="380" %)1 = Success,
1369 2 = GeneralError,
1370 3 = WrongSIKBVersion,
1371 4 = InvalidCredentials,
1372 5 = CustomerUsernameInvalid,
1373 6 = CustomerUsernameNotValidForCustomerCode
1374 7 = FileContentProblem,
1375 8 = InvalidOrderId,
1376 9 = OrderIdAlreadyApproved
1377 10 = PDFNotAvailable
1378 (% element-id="370" %)|(% element-id="369" %)12|(% element-id="368" %)Receives the PDF and stores it for reporting and downloading.|(% element-id="367" %) |(% element-id="365" %) |(% element-id="363" %) |(% element-id="361" %) |(% element-id="359" %)
1379
1380 (% element-id="357" %)
1381 = (% element-id="356" %)Customer wants to see real time information about the status in the interface(%%) =
1382
1383 (% element-id="354" %)
1384 == (% element-id="353" %)Solution/Design(%%) ==
1385
1386 (% element-id="352" %)
1387 To always show up-to-date information in the TerraIndex interface when a user opens a lab assignment to see the status, we reuse part of the GetOrderStatus, but with a specific OrderID.
1388
1389 (% element-id="351" %)
1390 ..NOT SUPPORTED YET...
1391
1392 (% class="table-hover" element-id="350" %)
1393 (% element-id="348" %)|(% colspan="1" element-id="347" %)Action|(% colspan="1" element-id="346" %)TerraIndex|(% colspan="1" element-id="345" %) |(% colspan="1" element-id="343" %)Laboratorium|(% colspan="1" element-id="342" %)Parameters/Message|(% colspan="1" element-id="341" %)Remarks|(% colspan="1" element-id="340" %)ResultCodes
1394 (% element-id="339" %)|(% element-id="338" %)1|(% element-id="337" %)Request the Order status for a single Order/Labassignment.
1395 Function: GetOrderStatus()|=(% element-id="335" %)>|(% element-id="334" %) |(% element-id="332" %)WebserviceUsername (string), 
1396 WebservicePassword (string),
1397 CustomerUsername (string),
1398 CustomerCode (string),
1399 OrderID (string),|(% element-id="327" %) |(% element-id="325" %)
1400 (% element-id="323" %)|(% element-id="322" %)2|(% element-id="321" %) |(% element-id="319" %) |(% element-id="317" %)Receives the request and gets the status for the Order.|(% element-id="316" %) |(% element-id="314" %) |(% element-id="312" %)
1401 (% element-id="310" %)|(% element-id="309" %)3|(% element-id="308" %) |(% element-id="306" %)<=|(% element-id="305" %)Sends back the status of the order.|(% element-id="304" %)ResultCode (),
1402 ErrorMessage (string),
1403 OrderID (string),
1404 LabassignmentGUID (GUID),
1405 CertificateNumber (string)
1406 OrderStatusSIKB (int),
1407 Delayed (boolean),
1408 ExpectedTimeStamp (DateTime),|(% element-id="296" %)OrderStatusSIKB is the SIKB Labassignment status.
1409 \\Delayed is a boolean to tell the customer a order will be later ready then expected. The ExpectedTimestamp.
1410 If Delayed for the firsttime, TerraIndex can send a notification to the users and show a different layout.
1411 \\LabassignmentGUID is filled to support also Labassignments that are not from TerraIndex Ordered.|(% element-id="290" %)1 = Success,
1412 2 = GeneralError,
1413 3 = WrongSIKBVersion,
1414 4 = InvalidCredentials,
1415 5 = CustomerUsernameInvalid,
1416 6 = CustomerUsernameNotValidForCustomerCode
1417 7 = FileContentProblem,
1418 8 = InvalidOrderId,
1419 9 = OrderIdAlreadyApproved
1420 10 = PDFNotAvailable
1421 (% element-id="280" %)|(% element-id="279" %)4|(% element-id="278" %)Receives the status and shows in the interface the updated info.
1422 Update the CertificateNr if this is not already present in the labassignment. |(% element-id="276" %) |(% element-id="274" %) |(% element-id="272" %) |(% element-id="270" %)CertifcateNumber could be new here, if the lab wasn't able to fill it directly at the ApproveOrder.|(% element-id="269" %)
1423
1424 (% element-id="265" %)
1425