Changes for page Download a project (export)
Last modified by Nico Lemaire on 2025/09/01 13:36
From version 6.1
edited by Robin Huisman
on 2022/04/21 11:57
on 2022/04/21 11:57
Change comment:
There is no comment for this version
To version 15.4
edited by Robert Jan Daams
on 2025/03/05 18:01
on 2025/03/05 18:01
Change comment:
There is no comment for this version
Summary
-
Page properties (4 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - Setting up a Webservice connectionforproject exports1 +Download a project (export) - Parent
-
... ... @@ -1,1 +1,1 @@ 1 -Implementation documentation.WebHome 1 +Implementation documentation.For customers.WebHome - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki.R obinHuisman1 +XWiki.RjDaams - Content
-
... ... @@ -16,6 +16,36 @@ 16 16 ((( 17 17 (% class="col-xs-12 col-sm-8" %) 18 18 ((( 19 +== Changelog == 20 + 21 +=== Update 2022-08-23 === 22 + 23 +As part of on-going efforts to improve performance and scalability, we have introduced a dedicated version of DataWS named DataWSExternals. This new service should be used for external API consumers. 24 + 25 +| |**URL**| 26 +|**Old**|{{code language="none"}}https://web.terraindex.com/DataWS/{{/code}}|((( 27 +[[https:~~/~~/web.terraindex.com/DataWS/ITWDataRestService_V1_0/GetProjectsJSON>>https://web.terraindex.com/DataWS/ITWDataRestService_V1_0/GetProjectsJSON]] 28 + 29 +[[https:~~/~~/web.terraindex.com/DataWS/ITWImportExportServiceASMX_V1_0.asmx>>https://web.terraindex.com/DataWSExternals/ITWImportExportServiceASMX_V1_0.asmx]] 30 +))) 31 +|**New**|{{code language="none"}}https://web.terraindex.com/DataWSExternals/{{/code}}|((( 32 +[[https:~~/~~/web.terraindex.com/DataWSExternals/ITWDataRestService_V1_0/GetProjectsJSON>>https://web.terraindex.com/DataWSExternals/ITWDataRestService_V1_0/GetProjectsJSON]] 33 + 34 +[[https:~~/~~/web.terraindex.com/DataWSExternals/ITWImportExportServiceASMX_V1_0.asmx>>https://web.terraindex.com/DataWSExternals/ITWImportExportServiceASMX_V1_0.asmx?wsdl]] 35 +))) 36 + 37 +== == 38 + 39 +{{info}} 40 +We also have new REST Calls, with the same Input Output formats: 41 +\\[[https:~~/~~/web.terraindex.com/datawsExternals/ITWImportExportRestService_V1_0/export>>https://web.terraindex.com/datawsExternals/ITWImportExportRestService_V1_0/export]] 42 + 43 +input as json: ExportRequest 44 +output as json: ExportResult 45 + 46 +as POST or GET 47 +{{/info}} 48 + 19 19 == 1. Retreive all changed project from TerraIndex == 20 20 21 21 To retreive all changed project from the TerraIndex database since a specific timestamp, there is a webservice call you can do. This will return all project rows that have changes since the timestamp you send within the request. ... ... @@ -22,7 +22,7 @@ 22 22 This way you only download projects that have changes, and it will not request project that are not needed, so it won’t keep our servers busy with exports that are not necessary. 23 23 24 24 To start connecting this webservice, you should use this URL: 25 -[[https:~~/~~/web.terraindex.com/DataWS/ITWDataRestService_V1_0/GetProjectsJSON>> url:https://web.terraindex.com/DataWS/ITWDataRestService_V1_0/GetProjectsJSON]]55 +[[https:~~/~~/web.terraindex.com/DataWSExternals/ITWDataRestService_V1_0/GetProjectsJSON>>https://web.terraindex.com/DataWSExternals/ITWDataRestService_V1_0/GetProjectsJSON]] 26 26 27 27 Fill the **Body **of a **POST **HTTP call with: 28 28 ... ... @@ -238,11 +238,12 @@ 238 238 == 2. Retreive the project export from TerraIndex == 239 239 240 240 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. 241 -The format of the projectfile is documentated here: [[Documentation TerraIndex Export format - dsFieldProject.xsd>>Implementation documentation.Documentation TerraIndex Export format - dsFieldProject\.xsd.WebHome]] 271 +The format of the projectfile is documentated here: [[Documentation TerraIndex Export format - dsFieldProject.xsd>>Implementation documentation.For customers.Documentation TerraIndex Export format - dsFieldProject\.xsd.WebHome]] 242 242 243 -To start connecting this webservice, you should use this URL of the Import Export Webservice: 244 -[[https:~~/~~/web.terraindex.com/DataWS/ITWImportExportServiceASMX_V1_0.asmx>>url:https://web.terraindex.com/DataWS/ITWImportExportServiceASMX_V1_0.asmx]] 273 +To start connecting this webservice, you should use this URL of the Import Export Webservice: 245 245 275 +[[https:~~/~~/web.terraindex.com/DataWSExternals/ITWImportExportService_V1_0.svc>>https://web.terraindex.com/DataWSExternals/ITWImportExportService_V1_0.svc]] 276 + 246 246 With this URL many IDE’s can create a proxy for you, just by providing the URL. Once this proxy is created, you will have a few classes looking like the call in the image below. 247 247 248 248 [[image:image-20200108-123431.png]] ... ... @@ -377,137 +377,7 @@ 377 377 </soap:Envelope> 378 378 {{/code}} 379 379 380 - 381 -== Zip Stream class == 382 - 383 -If needed, this is the Zip Stream class you can use to extract the zipstream as used above: 384 - 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}} 411 + 511 511 ))) 512 512 513 513