Last modified by Nico Lemaire on 2025/05/06 15:49
From version 3.1
edited by Robin Huisman
on 2022/02/08 11:50
on 2022/02/08 11:50
Change comment:
There is no comment for this version
To version 1.2
edited by Roelof Zwaan
on 2021/11/23 10:03
on 2021/11/23 10:03
Change comment:
There is no comment for this version
Summary
-
Page properties (3 modified, 0 added, 0 removed)
Details
- Page properties
-
- Parent
-
... ... @@ -1,1 +1,1 @@ 1 -Implementati ondocumentation.WebHome1 +Implementatie dcoumentatie.WebHome - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki.Ro binHuisman1 +XWiki.RoelofZwaan - Content
-
... ... @@ -91,56 +91,96 @@ 91 91 |9|Go back to step 5, for every Customer code, every language.| | | | | 92 92 |10|Process the LabDeliveryFiles| | | | | 93 93 94 + 94 94 == Get Customers (POST) == 95 95 96 96 === Request example === 97 97 98 98 |((( 99 -{{code language="C#"}} 100 100 public GetCustomersCall.Response GetCustomers(string WebserviceUsername, string WebservicePassword, string CustomerUsername) 101 - { 102 - GetCustomersCall.Response set = new GetCustomersCall.Response(); 103 103 104 - try 105 - { 106 - var content = new FormUrlEncodedContent(new[] 107 - { 108 - new KeyValuePair<string, string>("userName", WebserviceUsername), 109 - new KeyValuePair<string, string>("password", WebservicePassword), 110 - new KeyValuePair<string, string>("customerUsername", CustomerUsername), 111 - }); 102 + { 112 112 113 - HttpResponseMessage response = _HttpClient.PostAsync(_HttpClient.BaseAddress + "/GetCustomers", content).Result; 114 - response.EnsureSuccessStatusCode(); 115 - string responseMessage = response.Content.ReadAsStringAsync().Result; 104 + GetCustomersCall.Response set = new GetCustomersCall.Response(); 116 116 117 - if (string.IsNullOrEmpty(responseMessage)) 118 - { 119 - throw new Exception("Empty response from: [" + _HttpClient.BaseAddress + " / GetCustomers" + "]"); 120 - } 121 - using (var ms = new System.IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(responseMessage))) 122 - { 123 - XmlSerializer serializer = new XmlSerializer(typeof(GetCustomersCall.Response)); 124 - set = (GetCustomersCall.Response)serializer.Deserialize(ms); 125 - } 126 - } 127 - catch (Exception ex) 128 - { 129 - #region handle exception 130 - set.Status = new BusinessEntities.LabRestService.GetCustomersCall.ResponseStatus(); 131 - set.Status.StatusCode = ((int)ResultCodes.GeneralError).ToString(); 132 - set.Status.ErrorMessage = "Exception occurred in GetCustomers (username: " + WebserviceUsername + ", password: " + WebservicePassword + ") with message: " + ex.Message; 133 - ex.Data.Add("WebserviceUsername", WebserviceUsername); 134 - ex.Data.Add("WebservicePassword", WebservicePassword); 135 - ex.Data.Add("CustomerUsername", CustomerUsername); 136 - ExceptionHandler.HandleException(ex); 137 - #endregion 138 - } 139 - return set; 140 - } 141 -{{/code}} 142 142 143 - 107 + try 108 + 109 + { 110 + 111 + 112 + var content = new FormUrlEncodedContent(new[] 113 + 114 + { 115 + 116 + new KeyValuePair<string, string>("userName", WebserviceUsername), 117 + 118 + new KeyValuePair<string, string>("password", WebservicePassword), 119 + 120 + new KeyValuePair<string, string>("customerUsername", CustomerUsername), 121 + 122 + }); 123 + 124 + 125 + HttpResponseMessage response = _HttpClient.PostAsync(_HttpClient.BaseAddress + "/GetCustomers", content).Result; 126 + 127 + response.EnsureSuccessStatusCode(); 128 + 129 + string responseMessage = response.Content.ReadAsStringAsync().Result; 130 + 131 + 132 + if (string.IsNullOrEmpty(responseMessage)) 133 + 134 + { 135 + 136 + throw new Exception("Empty response from: [" + _HttpClient.BaseAddress + " / GetCustomers" + "]"); 137 + 138 + } 139 + 140 + using (var ms = new System.IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(responseMessage~)~)~) 141 + 142 + { 143 + 144 + XmlSerializer serializer = new XmlSerializer(typeof(GetCustomersCall.Response)); 145 + 146 + set = (GetCustomersCall.Response)serializer.Deserialize(ms); 147 + 148 + } 149 + 150 + 151 + } 152 + 153 + catch (Exception ex) 154 + 155 + { 156 + 157 + #region handle exception 158 + 159 + 160 + set.Status = new BusinessEntities.LabRestService.GetCustomersCall.ResponseStatus(); 161 + 162 + set.Status.StatusCode = ((int)ResultCodes.GeneralError).ToString(); 163 + 164 + set.Status.ErrorMessage = "Exception occurred in GetCustomers (username: " + WebserviceUsername + ", password: " + WebservicePassword + ") with message: " + ex.Message; 165 + 166 + 167 + ex.Data.Add("WebserviceUsername", WebserviceUsername); 168 + 169 + ex.Data.Add("WebservicePassword", WebservicePassword); 170 + 171 + ex.Data.Add("CustomerUsername", CustomerUsername); 172 + 173 + 174 + ExceptionHandler.HandleException(ex); 175 + 176 + #endregion 177 + 178 + } 179 + 180 + 181 + return set; 182 + 183 + } 144 144 ))) 145 145 146 146 |((( ... ... @@ -161,23 +161,30 @@ 161 161 === Response example === 162 162 163 163 |((( 164 -{{code language="XML"}} 165 165 <?xml version="1.0" encoding="UTF-8" standalone="no"?> 205 + 166 166 <Response><Customers> 167 - <Customer LabId="1" LabName="Example Laboratorium" CustomerId="300" CustomerName="Adviesbureau De bodemkoning - Rotterdam" LastModifiedOnClient="2019-05-08T11:05:14.17+02:00" /> 168 - <Customer LabId="1" LabName="Example Laboratorium" CustomerId="656" CustomerName="Adviesbureau De bodemkoning - Delft" LastModifiedOnClient="2019-04-19T13:20:10.123+02:00" /> 207 + 208 + <Customer LabId="1" LabName="Example Laboratorium" CustomerId="300" CustomerName="Adviesbureau De bodemkoning - Rotterdam" LastModifiedOnClient="2019-05-08T11:05:14.17+02:00" /> 209 + 210 + <Customer LabId="1" LabName="Example Laboratorium" CustomerId="656" CustomerName="Adviesbureau De bodemkoning - Delft" LastModifiedOnClient="2019-04-19T13:20:10.123+02:00" /> 211 + 169 169 </Customers> 213 + 170 170 <Status> 171 - <StatusCode>1</StatusCode> 172 - <StatusCodeDescription>OK</StatusCodeDescription> 173 - <ErrorMessage></ErrorMessage> 215 + 216 + <StatusCode>1</StatusCode> 217 + 218 + <StatusCodeDescription>OK</StatusCodeDescription> 219 + 220 + <ErrorMessage></ErrorMessage> 221 + 174 174 </Status> 175 -</Response> 176 -{{/code}} 177 177 178 - 224 +</Response> 179 179 ))) 180 180 227 + 181 181 == Get Products (POST) == 182 182 183 183 === Request example === ... ... @@ -339,6 +339,8 @@ 339 339 </Status></Response> 340 340 ))) 341 341 389 + 390 + 342 342 = Gebruikersaccount controleren. = 343 343 344 344 ... ... @@ -902,6 +902,8 @@ 902 902 </Status></Response> 903 903 ))) 904 904 954 + 955 + 905 905 = Get Order status and Results = 906 906 907 907 == Oplossing/Design == ... ... @@ -1070,3 +1070,6 @@ 1070 1070 1071 1071 1072 1072 1124 + 1125 + 1126 +