Last modified by Nico Lemaire on 2025/05/06 15:49

From version 23.1
edited by Robin Huisman
on 2024/09/06 11:29
Change comment: There is no comment for this version
To version 22.2
edited by Robin Huisman
on 2024/09/06 11:26
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1456,9 +1456,9 @@
1456 1456   return set;
1457 1457   }
1458 1458  
1459 -== Response Status XML Example ==
1459 +== Response XML Example ==
1460 1460  
1461 - <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1461 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1462 1462   <Response>
1463 1463   <Orders>
1464 1464   <Order>
... ... @@ -1507,93 +1507,7 @@
1507 1507   </Response>
1508 1508  
1509 1509  
1510 -== Request example Order XML ==
1511 1511  
1512 -
1513 -public GetOrderResultsCall.Response GetOrderResults(string WebserviceUsername, string WebservicePassword, string CustomerUsername, string customerid, string orderid, string sikbVersion)
1514 - {
1515 - GetOrderResultsCall.Response set = new GetOrderResultsCall.Response();
1516 - string responseMessage = null;
1517 - try
1518 - {
1519 - bool useZipstream = true;
1520 - var content = new FormUrlEncodedContent(new[]
1521 - {
1522 - new KeyValuePair<string, string>("userName", WebserviceUsername),
1523 - new KeyValuePair<string, string>("password", WebservicePassword),
1524 - new KeyValuePair<string, string>("customerUsername", CustomerUsername),
1525 - new KeyValuePair<string, string>("clientId", customerid),
1526 - new KeyValuePair<string, string>("orderId", orderid),
1527 - new KeyValuePair<string, string>("sikbVersion", sikbVersion),
1528 - new KeyValuePair<string, string>("useZip", useZipstream.ToString() ),
1529 - });
1530 -
1531 - HttpResponseMessage response = _HttpClient.PostAsync(_HttpClient.BaseAddress + "/GetOrderResults", content).GetAwaiter().GetResult();
1532 - responseMessage = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();
1533 - response.EnsureSuccessStatusCode();
1534 -
1535 - if (string.IsNullOrEmpty(responseMessage))
1536 - {
1537 - throw new Exception("Empty response from: [" + _HttpClient.BaseAddress + " /GetOrderResults" + "]");
1538 - }
1539 - using (var ms = new System.IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(responseMessage~)~)~)
1540 - {
1541 - XmlSerializer serializer = new XmlSerializer(typeof(GetOrderResultsCall.Response));
1542 - set = (GetOrderResultsCall.Response)serializer.Deserialize(ms);
1543 - }
1544 -
1545 - if (useZipstream && !string.IsNullOrEmpty(set.FileContent))
1546 - {
1547 - ~/~/convert from base64 string back to normal
1548 - ~/~/first check for real Base64, by checking there is no 'xml' in it
1549 - ~/~/If encoded, it wont contain either of the root XML tags of SIKB
1550 - if (!set.FileContent.Contains("FeatureCollectionIMSIKB0101") && !set.FileContent.Contains("labresultaat"))
1551 - {
1552 - set.FileContent = ZipStreamHelper.DecompressBase64StringToString(set.FileContent);
1553 - }
1554 - }
1555 -
1556 - }
1557 - catch (Exception ex)
1558 - {
1559 - #region handle exception
1560 -
1561 - set.Status = new BusinessEntities.LabRestService.GetOrderResultsCall.ResponseStatus();
1562 - set.Status.StatusCode = ((int)ResultCodes.GeneralError).ToString();
1563 - set.Status.ErrorMessage = "Exception occurred in GetOrderResults (username: " + WebserviceUsername + ", password: " + WebservicePassword + ") with message: " + ex.ToString();
1564 -
1565 - ex.Data.Add("Response", responseMessage);
1566 - ex.Data.Add("WebserviceUsername", WebserviceUsername);
1567 - ex.Data.Add("WebservicePassword", WebservicePassword);
1568 - ex.Data.Add("CustomerUsername", CustomerUsername);
1569 - ex.Data.Add("sikbVersion", sikbVersion);
1570 - ex.Data.Add("customerid", customerid);
1571 - ex.Data.Add("orderId", orderid);
1572 - ex.Data.Add("Result", set);
1573 -
1574 - throw;
1575 - #endregion
1576 - }
1577 -
1578 - return set;
1579 -
1580 -
1581 -== Response Order XML Example ==
1582 -
1583 -
1584 -<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1585 - <Response>
1586 - <FileContent>DhVn3Q1AA==</FileContent>  ~/~/BASE64 Zip Stream, SIKB0101 labresults xml file
1587 - <Status>
1588 - <StatusCode>1</StatusCode>
1589 - <StatusCodeDescription>OK</StatusCodeDescription>
1590 - <AtmisErrorCode>0</AtmisErrorCode>  
1591 - <ErrorMessage></ErrorMessage>
1592 - </Status>
1593 - </Response>
1594 -
1595 -
1596 -
1597 1597  (% element-id="357" %)
1598 1598  = (% element-id="356" %)Customer wants to see real time information about the status in the interface(%%) =
1599 1599