<
From version < 1.2 >
edited by Roelof Zwaan
on 2021/11/22 10:41
To version < 6.1 >
edited by Robin Huisman
on 2022/04/21 11:57
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Parent
... ... @@ -1,1 +1,1 @@
1 -Implementatie dcoumentatie.WebHome
1 +Implementation documentation.WebHome
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.RoelofZwaan
1 +XWiki.RobinHuisman
Content
... ... @@ -8,6 +8,10 @@
8 8  )))
9 9  )))
10 10  
11 +{{box title="**Contents**"}}
12 +[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||height="15" role="presentation" title="Click and drag to move" width="15"]]
13 +{{/box}}
14 +
11 11  (% class="row" %)
12 12  (((
13 13  (% class="col-xs-12 col-sm-8" %)
... ... @@ -32,7 +32,7 @@
32 32   "Language": "en"
33 33   },
34 34   "LanguageCode": "en",
35 - "WebserviceVersion": 1,
39 + "WebserviceVersion": "1.0",
36 36   "SearchFilter": "",
37 37   "ArchiveID": 0,
38 38   "PageSize": 30,
... ... @@ -234,7 +234,7 @@
234 234  == 2. Retreive the project export from TerraIndex ==
235 235  
236 236  To request the export from TerraIndex we have a SOAP webservice. This webservice is called the ExportService, and it will provide a full project in TerraIndex Format.
237 -The format of the projectfile is documentated here: [[Documentation TerraIndex Export format - dsFieldProject.xsd>>Implementatie dcoumentatie.Documentation TerraIndex Export format - dsFieldProject\.xsd.WebHome]]
241 +The format of the projectfile is documentated here: [[Documentation TerraIndex Export format - dsFieldProject.xsd>>Implementation documentation.Documentation TerraIndex Export format - dsFieldProject\.xsd.WebHome]]
238 238  
239 239  To start connecting this webservice, you should use this URL of the Import Export Webservice:
240 240  [[https:~~/~~/web.terraindex.com/DataWS/ITWImportExportServiceASMX_V1_0.asmx>>url:https://web.terraindex.com/DataWS/ITWImportExportServiceASMX_V1_0.asmx]]
... ... @@ -252,12 +252,15 @@
252 252  Also fill the license and the applicationCode. //(These two fields can be requested at the TerraIndex Servicedesk.)//
253 253  5; Fill the **ExportType **'**Export_FIELD_XML_v1_0_0**’. This export corresponds with dsFieldProject.xsd and is the best XML to connect TI with.
254 254  Create at least create 2 parameters as in the image. Beacause 2 parameters are needed.
259 +//If JSON is prevered use: ExportType = 'Export_FIELD_JSON_v1_0_0'//
255 255  6; Fill the parameter with the FileName.
256 256  7; Fill the parameter with **projectID**. Instead of ‘ProjectID' it’s also possible to fill the parameter ‘ProjectCode'.
257 257  8; Send the request and wait for the reponse. In response field ‘ResultCode’ should be 'SUCCES’ when it all went OK. If not it will tell what went wrong.
258 258  9; The response field 'Filecontent’is filled if it went OK, and it contains XML you can serialize.
259 -\\*Username and password are known by each TI user and the application manager of your company can create new usernames.
264 +10; an extra parameter is added calles: **UseZipStream**. The result data is default Base64 encoded, if you add UseZipStream = true, the result string is GZIPSTREAMED Base64 encoded. **At the end of this page, we have added an class as code, to parse the base64 or ZIPStream Base64 to a normal string.**
265 +*Username and password are known by each TI user and the application manager of your company can create new usernames.
260 260  
267 +
261 261  **EXAMPLE CODE**
262 262  
263 263  ExportType:
... ... @@ -299,11 +299,76 @@
299 299  
300 300  Example call
301 301  
302 -<soapenv:Envelope xmlns:soapenv="http:~/~/schemas.xmlsoap.org/soap/envelope/" xmlns:itw="https:~/~/wsterraindex.terraindex.com/ITWorks.TerraIndex/"> <soapenv:Header/> <soapenv:Body> <itw:Export> <itw:request> <itw:AuthorisationRequest> <itw:Username>USERNAME</itw:Username> <itw:Password>PASSWORD</itw:Password> <itw:Licensenumber>LICENSE</itw:Licensenumber> <itw:ApplicationCode>APPCODE</itw:ApplicationCode> </itw:AuthorisationRequest> <itw:WebserviceVersion>1.0</itw:WebserviceVersion> <itw:LanguageCode>nld</itw:LanguageCode> <itw:UseCompression>true</itw:UseCompression> <itw:TypeOfExport>Export_FIELD_XML_v1_0_0</itw:TypeOfExport> <itw:Parameters> <itw:ExportParameter> <itw:ParameterType>FileName</itw:ParameterType> <itw:StringValue>Export</itw:StringValue> </itw:ExportParameter> <itw:ExportParameter> <itw:ParameterType>projectID</itw:ParameterType> <itw:FloatValue>917</itw:FloatValue> </itw:ExportParameter> ~-~-~-~-- <itw:ExportParameter> <itw:ParameterType>ProjectCode</itw:ParameterType> <itw:StringValue>202020</itw:StringValue> </itw:ExportParameter> ~-~-~-~- </itw:Parameters> <itw:LogFormat>XML</itw:LogFormat> <itw:UseZipStream>true</itw:UseZipStream> </itw:request> </itw:Export> </soapenv:Body></soapenv:Envelope>
309 +{{code language="none" layout="LINENUMBERS"}}
310 +<soapenv:Envelope
311 + xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
312 + xmlns:itw="https://wsterraindex.terraindex.com/ITWorks.TerraIndex/">
313 + <soapenv:Header></soapenv:Header>
314 + <soapenv:Body>
315 + <itw:Export>
316 + <itw:request>
317 + <itw:AuthorisationRequest>
318 + <itw:Username>USERNAME</itw:Username>
319 + <itw:Password>PASSWORD</itw:Password>
320 + <itw:Licensenumber>LICENSE</itw:Licensenumber>
321 + <itw:ApplicationCode>APPCODE</itw:ApplicationCode>
322 + </itw:AuthorisationRequest>
323 + <itw:WebserviceVersion>1.0</itw:WebserviceVersion>
324 + <itw:LanguageCode>nld</itw:LanguageCode>
325 + <itw:UseCompression>true</itw:UseCompression>
326 + <itw:TypeOfExport>Export_FIELD_XML_v1_0_0</itw:TypeOfExport>
327 + <itw:Parameters>
328 + <itw:ExportParameter>
329 + <itw:ParameterType>FileName</itw:ParameterType>
330 + <itw:StringValue>Export</itw:StringValue>
331 + </itw:ExportParameter>
332 + <itw:ExportParameter>
333 + <itw:ParameterType>projectID</itw:ParameterType>
334 + <itw:FloatValue>917</itw:FloatValue>
335 + </itw:ExportParameter> -----
336 + <itw:ExportParameter>
337 + <itw:ParameterType>ProjectCode</itw:ParameterType>
338 + <itw:StringValue>202020</itw:StringValue>
339 + </itw:ExportParameter> ----
340 + </itw:Parameters>
341 + <itw:LogFormat>XML</itw:LogFormat>
342 + <itw:UseZipStream>true</itw:UseZipStream>
343 + </itw:request>
344 + </itw:Export>
345 + </soapenv:Body>
346 +</soapenv:Envelope>
347 +{{/code}}
303 303  
304 304  Example response:
305 305  
306 -<soap:Envelope xmlns:soap="http:~/~/schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http:~/~/www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http:~/~/www.w3.org/2001/XMLSchema"> <soap:Body> <ExportResponse xmlns="https:~/~/wsterraindex.terraindex.com/ITWorks.TerraIndex/"> <ExportResult> <ResultCode>Export_Succes</ResultCode> <TypeOfExport>Export_TI_v1_0_0</TypeOfExport> <Files> <File> <FileName>917.xml</FileName> <TypeOfFile>Field_XML_Compressed</TypeOfFile> <FileContent>H4sIAAAAAAAEAFWRuZaqQABEP4hAGnAGggm6odlREFkkA2WRRRCBxv76YeYF70yFVXUqqBvgl4KQBzcZ8Aho2iqxdhxDSPDmNGjz9Z/weMa8/aimTAUeF42KgxRRzd3YaGfdXtvECEBvWafSNwf+dOsjVXpZUzs+lw/p3gBhuXQ5S8T3MdIBlxUQEam+LOVgVo4D8w4c2E8pEgp3haewcpQx1KQ41Z8DKWv16seaDLp3GABLuIKXK5Ucq31EfSXm0172YvG87hcbayYGdB1t0CbcuueLpU5UawgHSitFr564Aet5LeegD0/tocZDTvuIuc9Ja0tDFt/m7kZnomdVJc+2SkqBGXmTdPiiPzJa2OznLkX67p2PCNM7iHU11QbIilVkMDBVd0J8gK4Ams6ycJQagnww/SaxuiZ/EdS6DZ0cf17BIhUq87CSkQvxat/2dEG1xu94BoaeT7C8XR38/C1DZbpygwfW+gk8Z+Mgm3DDhAj8r6099Rj+5YNs5F3+5R5EUPmd6+EvYvj1Dd8o9lLwAQAA</FileContent> </File> <File> <FileName>ProjectInfo.xml</FileName> <TypeOfFile>Field_XML_Compressed</TypeOfFile> <FileContent>H4sIAAAAAAAEAI1Qy5JDQAD8IAdj1/M4hJggDBnEbTxDsV7BxtdvNqm9bx+6urq7+tBEnw+qiuETCLrcTlst9Pajtb0soj7JeynztNIubHK9XZJOXoojN8dXpaxltOlOwAZzK033Edx7HWT1ZFVYNljpsT7iCVDbxb5tlmw3GhV7vgty5jqiGzWSYEvL7RCIQifzchIoMJnHz+fO17C4JAwA0hNRb247SR1ba8OunCV4ralK1rjwBhUAJ2pihopeuxqXIUecePETLhx8zT6IZX5GzafC0XHTrauISeyIM2+2g1PzEymRZrTtglKlsFYHXDKmoYTp+jw1zNDyAFZOTN9XHkuNGmU33905uipWMTsjm2ccm6+bxqk2xAjCf/z3BwS1j+qVqTjrlDGJziCIhC59CHwafeNgI8d3U4cQQ+VXSdXb+QGLuAuvrAEAAA==</FileContent> </File> </Files> </ExportResult> </ExportResponse> </soap:Body></soap:Envelope>
351 +{{code language="none"}}
352 +<soap:Envelope
353 + xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
354 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
355 + xmlns:xsd="http://www.w3.org/2001/XMLSchema">
356 + <soap:Body>
357 + <ExportResponse
358 + xmlns="https://wsterraindex.terraindex.com/ITWorks.TerraIndex/">
359 + <ExportResult>
360 + <ResultCode>Export_Succes</ResultCode>
361 + <TypeOfExport>Export_TI_v1_0_0</TypeOfExport>
362 + <Files>
363 + <File>
364 + <FileName>917.xml</FileName>
365 + <TypeOfFile>Field_XML_Compressed</TypeOfFile>
366 + <FileContent>H4sIAAAAAAAEAFWRuZaqQABEP4hAGnAGggm6odlREFkkA2WRRRCBxv76YeYF70yFVXUqqBvgl4KQBzcZ8Aho2iqxdhxDSPDmNGjz9Z/weMa8/aimTAUeF42KgxRRzd3YaGfdXtvECEBvWafSNwf+dOsjVXpZUzs+lw/p3gBhuXQ5S8T3MdIBlxUQEam+LOVgVo4D8w4c2E8pEgp3haewcpQx1KQ41Z8DKWv16seaDLp3GABLuIKXK5Ucq31EfSXm0172YvG87hcbayYGdB1t0CbcuueLpU5UawgHSitFr564Aet5LeegD0/tocZDTvuIuc9Ja0tDFt/m7kZnomdVJc+2SkqBGXmTdPiiPzJa2OznLkX67p2PCNM7iHU11QbIilVkMDBVd0J8gK4Ams6ycJQagnww/SaxuiZ/EdS6DZ0cf17BIhUq87CSkQvxat/2dEG1xu94BoaeT7C8XR38/C1DZbpygwfW+gk8Z+Mgm3DDhAj8r6099Rj+5YNs5F3+5R5EUPmd6+EvYvj1Dd8o9lLwAQAA</FileContent>
367 + </File>
368 + <File>
369 + <FileName>ProjectInfo.xml</FileName>
370 + <TypeOfFile>Field_XML_Compressed</TypeOfFile>
371 + <FileContent>H4sIAAAAAAAEAI1Qy5JDQAD8IAdj1/M4hJggDBnEbTxDsV7BxtdvNqm9bx+6urq7+tBEnw+qiuETCLrcTlst9Pajtb0soj7JeynztNIubHK9XZJOXoojN8dXpaxltOlOwAZzK033Edx7HWT1ZFVYNljpsT7iCVDbxb5tlmw3GhV7vgty5jqiGzWSYEvL7RCIQifzchIoMJnHz+fO17C4JAwA0hNRb247SR1ba8OunCV4ralK1rjwBhUAJ2pihopeuxqXIUecePETLhx8zT6IZX5GzafC0XHTrauISeyIM2+2g1PzEymRZrTtglKlsFYHXDKmoYTp+jw1zNDyAFZOTN9XHkuNGmU33905uipWMTsjm2ccm6+bxqk2xAjCf/z3BwS1j+qVqTjrlDGJziCIhC59CHwafeNgI8d3U4cQQ+VXSdXb+QGLuAuvrAEAAA==</FileContent>
372 + </File>
373 + </Files>
374 + </ExportResult>
375 + </ExportResponse>
376 + </soap:Body>
377 +</soap:Envelope>
378 +{{/code}}
307 307  
308 308  
309 309  == Zip Stream class ==
... ... @@ -310,16 +310,137 @@
310 310  
311 311  If needed, this is the Zip Stream class you can use to extract the zipstream as used above:
312 312  
313 -~/~// <summary> ~/~// Helper class for compress en decompress of file data ~/~// </summary> public static class ZipStreamHelper { #region Compress and encode ~/~// <summary> ~/~// Comprimeer een string en geeft deze terug in Base64 string. ~/~// </summary> ~/~// <param name="content">filecontent</param> ~/~// <returns>gecomprimeerde string</returns> public static string CompressToBase64String(string content) { ~/~/string to byte[] byte[] contentArray = stringToByteArray(content); ~/~/ Compress byte[] compressed = Compress(contentArray); return base64_encode(compressed); } ~/~// <summary> ~/~// Zet een string om naar een ByteArray ~/~// </summary> ~/~// <param name="content">filecontent</param> ~/~// <returns>ByteArray</returns> public static byte[] stringToByteArray(string content) { System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding(); return encoding.GetBytes(content); } ~/~// <summary> ~/~// comprimeer een ByteArray ~/~// </summary> ~/~// <param name="data">filedata als ByteArray</param> ~/~// <returns>gecomprimeerde ByteArray</returns> public static byte[] Compress(byte[] data) { using (var compressedStream = new MemoryStream()) using (var zipStream = new GZipStream(compressedStream, CompressionMode.Compress)) { zipStream.Write(data, 0, data.Length); zipStream.Close(); return compressedStream.ToArray(); } } ~/~// <summary> ~/~// Zet een ByteArray om naar een Base64 string ~/~// </summary> ~/~// <param name="data">gecomprimeerde ByteArray</param> ~/~// <returns>Base 64 string</returns> public static string base64_encode(byte[] data) { if (data == null) return string.Empty; return Convert.ToBase64String(data); } ~/~// <summary> ~/~// Zet een string om naar een Base64 string ~/~// </summary> ~/~// <param name="data">string</param> ~/~// <returns>Base 64 string</returns> public static string string_base64_encode(string data) { if (string.IsNullOrEmpty(data)) return string.Empty; ~/~/string to byte[] byte[] contentArray = stringToByteArray(data); return base64_encode(contentArray); } #endregion #region Decompress and decode ~/~/ Decode and decompress ~/~// <summary> ~/~// Decomprimeer een Base64 string naar een string ~/~// </summary> ~/~// <param name="contentBase64">GZIP Base64 string</param> ~/~// <returns>string</returns> public static string DecompressBase64StringToString(string contentBase64) { ~/~/ Decompress byte[] decoded = base64_decode(contentBase64); byte[] decompressed = Decompress(decoded); return byteArrayTostring(decompressed); } ~/~// <summary> ~/~// Zet een ByteArray om in een normale string ~/~// </summary> ~/~// <param name="data">ByteArray</param> ~/~// <returns>string</returns> public static string byteArrayTostring(byte[] data) { System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding(); return enc.GetString(data); } ~/~// <summary> ~/~// Zet een Base64 string om naar een ByteArray ~/~// </summary> ~/~// <param name="encodedData">Base64 string</param> ~/~// <returns>gecomprimeerde ByteArray</returns> public static byte[] base64_decode(string encodedData) { byte[] encodedDataAsBytes = Convert.FromBase64String(encodedData); return encodedDataAsBytes; } ~/~// <summary> ~/~// Zet een gecomprimeerde ByteArray om in een ByteArray ~/~// </summary> ~/~// <param name="data">gecomprimeerde ByteArray</param> ~/~// <returns>ByteArray (gedecomprimeerd)</returns> public static byte[] Decompress(byte[] data) { using (var compressedStream = new MemoryStream(data)) using (var zipStream = new GZipStream(compressedStream, CompressionMode.Decompress)) using (var resultStream = new MemoryStream()) { var buffer = new byte[4096]; int read; while ((read = zipStream.Read(buffer, 0, buffer.Length)) > 0) { resultStream.Write(buffer, 0, read); } return resultStream.ToArray(); } } #endregion }
385 +{{code language="Csharp" layout="LINENUMBERS"}}
386 +/// <summary>
387 +/// Helper class for compress en decompress of file data
388 +/// </summary>
389 +public static class ZipStreamHelper {
390 + #region Compress and encode
391 + /// <summary>
392 + /// Comprimeer een string en geeft deze terug in Base64 string.
393 + /// </summary>
394 + /// <param name="content">filecontent</param>
395 + /// <returns>gecomprimeerde string</returns>
396 + public static string CompressToBase64String(string content) {
397 + //string to byte[]
398 + byte[] contentArray = stringToByteArray(content);
399 + // Compress
400 + byte[] compressed = Compress(contentArray);
401 + return base64_encode(compressed);
402 + }
403 +
404 + /// <summary>
405 + /// Zet een string om naar een ByteArray
406 + /// </summary>
407 + /// <param name="content">filecontent</param>
408 + /// <returns>ByteArray</returns>
409 + public static byte[] stringToByteArray(string content) {
410 + System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
411 + return encoding.GetBytes(content);
412 + }
413 +
414 + /// <summary>
415 + /// comprimeer een ByteArray
416 + /// </summary>
417 + /// <param name="data">filedata als ByteArray</param>
418 + /// <returns>gecomprimeerde ByteArray</returns>
419 + public static byte[] Compress(byte[] data) {
420 + using(var compressedStream = new MemoryStream())
421 + using(var zipStream = new GZipStream(compressedStream, CompressionMode.Compress)) {
422 + zipStream.Write(data, 0, data.Length);
423 + zipStream.Close();
424 + return compressedStream.ToArray();
425 + }
426 + }
427 +
428 + /// <summary>
429 + /// Zet een ByteArray om naar een Base64 string
430 + /// </summary>
431 + /// <param name="data">gecomprimeerde ByteArray</param>
432 + /// <returns>Base 64 string</returns>
433 + public static string base64_encode(byte[] data) {
434 + if (data == null)
435 + return string.Empty;
436 + return Convert.ToBase64String(data);
437 + }
438 +
439 + /// <summary>
440 + /// Zet een string om naar een Base64 string
441 + /// </summary>
442 + /// <param name="data">string</param>
443 + /// <returns>Base 64 string</returns>
444 + public static string string_base64_encode(string data) {
445 + if (string.IsNullOrEmpty(data))
446 + return string.Empty;
447 +
448 + //string to byte[]
449 + byte[] contentArray = stringToByteArray(data);
450 + return base64_encode(contentArray);
451 + }
452 + #endregion
453 +
454 + #region Decompress and decode
455 + // Decode and decompress
456 + /// <summary>
457 + /// Decomprimeer een Base64 string naar een string
458 + /// </summary>
459 + /// <param name="contentBase64">GZIP Base64 string</param>
460 + /// <returns>string</returns>
461 + public static string DecompressBase64StringToString(string contentBase64) {
462 + // Decompress
463 + byte[] decoded = base64_decode(contentBase64);
464 + byte[] decompressed = Decompress(decoded);
465 +
466 + return byteArrayTostring(decompressed);
467 + }
468 +
469 + /// <summary>
470 + /// Zet een ByteArray om in een normale string
471 + /// </summary>
472 + /// <param name="data">ByteArray</param>
473 + /// <returns>string</returns>
474 + public static string byteArrayTostring(byte[] data) {
475 + System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
476 + return enc.GetString(data);
477 + }
478 +
479 + /// <summary>
480 + /// Zet een Base64 string om naar een ByteArray
481 + /// </summary>
482 + /// <param name="encodedData">Base64 string</param>
483 + /// <returns>gecomprimeerde ByteArray</returns>
484 + public static byte[] base64_decode(string encodedData) {
485 + byte[] encodedDataAsBytes = Convert.FromBase64String(encodedData);
486 + return encodedDataAsBytes;
487 + }
488 +
489 + /// <summary>
490 + /// Zet een gecomprimeerde ByteArray om in een ByteArray
491 + /// </summary>
492 + /// <param name="data">gecomprimeerde ByteArray</param>
493 + /// <returns>ByteArray (gedecomprimeerd)</returns>
494 + public static byte[] Decompress(byte[] data) {
495 + using(var compressedStream = new MemoryStream(data))
496 + using(var zipStream = new GZipStream(compressedStream, CompressionMode.Decompress))
497 + using(var resultStream = new MemoryStream()) {
498 + var buffer = new byte[4096];
499 + int read;
500 +
501 + while ((read = zipStream.Read(buffer, 0, buffer.Length)) > 0) {
502 + resultStream.Write(buffer, 0, read);
503 + }
504 +
505 + return resultStream.ToArray();
506 + }
507 + }
508 + #endregion
509 +}
510 +{{/code}}
314 314  )))
315 315  
316 316  
317 317  (% class="col-xs-12 col-sm-4" %)
318 318  (((
319 -{{box title="**Contents**"}}
320 -{{toc/}}
321 -{{/box}}
322 -
323 323  
324 324  )))
325 325  )))
TerraIndex
asd