Changes for page Download a project (export)
Last modified by Robert Jan Daams on 2025/03/05 18:02
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- 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" %) ... ... @@ -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> 306 +{{code language="none" layout="LINENUMBERS"}} 307 +<soapenv:Envelope 308 + xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 309 + xmlns:itw="https://wsterraindex.terraindex.com/ITWorks.TerraIndex/"> 310 + <soapenv:Header/> 311 + <soapenv:Body> 312 + <itw:Export> 313 + <itw:request> 314 + <itw:AuthorisationRequest> 315 + <itw:Username>USERNAME</itw:Username> 316 + <itw:Password>PASSWORD</itw:Password> 317 + <itw:Licensenumber>LICENSE</itw:Licensenumber> 318 + <itw:ApplicationCode>APPCODE</itw:ApplicationCode> 319 + </itw:AuthorisationRequest> 320 + <itw:WebserviceVersion>1.0</itw:WebserviceVersion> 321 + <itw:LanguageCode>nld</itw:LanguageCode> 322 + <itw:UseCompression>true</itw:UseCompression> 323 + <itw:TypeOfExport>Export_FIELD_XML_v1_0_0</itw:TypeOfExport> 324 + <itw:Parameters> 325 + <itw:ExportParameter> 326 + <itw:ParameterType>FileName</itw:ParameterType> 327 + <itw:StringValue>Export</itw:StringValue> 328 + </itw:ExportParameter> 329 + <itw:ExportParameter> 330 + <itw:ParameterType>projectID</itw:ParameterType> 331 + <itw:FloatValue>917</itw:FloatValue> 332 + </itw:ExportParameter> ----- 333 + <itw:ExportParameter> 334 + <itw:ParameterType>ProjectCode</itw:ParameterType> 335 + <itw:StringValue>202020</itw:StringValue> 336 + </itw:ExportParameter> ---- 337 + </itw:Parameters> 338 + <itw:LogFormat>XML</itw:LogFormat> 339 + <itw:UseZipStream>true</itw:UseZipStream> 340 + </itw:request> 341 + </itw:Export> 342 + </soapenv:Body> 343 +</soapenv:Envelope> 344 +{{/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> 348 +{{code language="none"}} 349 +<soap:Envelope 350 + xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 351 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 352 + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 353 + <soap:Body> 354 + <ExportResponse 355 + xmlns="https://wsterraindex.terraindex.com/ITWorks.TerraIndex/"> 356 + <ExportResult> 357 + <ResultCode>Export_Succes</ResultCode> 358 + <TypeOfExport>Export_TI_v1_0_0</TypeOfExport> 359 + <Files> 360 + <File> 361 + <FileName>917.xml</FileName> 362 + <TypeOfFile>Field_XML_Compressed</TypeOfFile> 363 + <FileContent>H4sIAAAAAAAEAFWRuZaqQABEP4hAGnAGggm6odlREFkkA2WRRRCBxv76YeYF70yFVXUqqBvgl4KQBzcZ8Aho2iqxdhxDSPDmNGjz9Z/weMa8/aimTAUeF42KgxRRzd3YaGfdXtvECEBvWafSNwf+dOsjVXpZUzs+lw/p3gBhuXQ5S8T3MdIBlxUQEam+LOVgVo4D8w4c2E8pEgp3haewcpQx1KQ41Z8DKWv16seaDLp3GABLuIKXK5Ucq31EfSXm0172YvG87hcbayYGdB1t0CbcuueLpU5UawgHSitFr564Aet5LeegD0/tocZDTvuIuc9Ja0tDFt/m7kZnomdVJc+2SkqBGXmTdPiiPzJa2OznLkX67p2PCNM7iHU11QbIilVkMDBVd0J8gK4Ams6ycJQagnww/SaxuiZ/EdS6DZ0cf17BIhUq87CSkQvxat/2dEG1xu94BoaeT7C8XR38/C1DZbpygwfW+gk8Z+Mgm3DDhAj8r6099Rj+5YNs5F3+5R5EUPmd6+EvYvj1Dd8o9lLwAQAA</FileContent> 364 + </File> 365 + <File> 366 + <FileName>ProjectInfo.xml</FileName> 367 + <TypeOfFile>Field_XML_Compressed</TypeOfFile> 368 + <FileContent>H4sIAAAAAAAEAI1Qy5JDQAD8IAdj1/M4hJggDBnEbTxDsV7BxtdvNqm9bx+6urq7+tBEnw+qiuETCLrcTlst9Pajtb0soj7JeynztNIubHK9XZJOXoojN8dXpaxltOlOwAZzK033Edx7HWT1ZFVYNljpsT7iCVDbxb5tlmw3GhV7vgty5jqiGzWSYEvL7RCIQifzchIoMJnHz+fO17C4JAwA0hNRb247SR1ba8OunCV4ralK1rjwBhUAJ2pihopeuxqXIUecePETLhx8zT6IZX5GzafC0XHTrauISeyIM2+2g1PzEymRZrTtglKlsFYHXDKmoYTp+jw1zNDyAFZOTN9XHkuNGmU33905uipWMTsjm2ccm6+bxqk2xAjCf/z3BwS1j+qVqTjrlDGJziCIhC59CHwafeNgI8d3U4cQQ+VXSdXb+QGLuAuvrAEAAA==</FileContent> 369 + </File> 370 + </Files> 371 + </ExportResult> 372 + </ExportResponse> 373 + </soap:Body> 374 +</soap:Envelope> 375 +{{/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 } 382 +{{code language="Csharp" layout="LINENUMBERS"}} 383 +/// <summary> 384 +/// Helper class for compress en decompress of file data 385 +/// </summary> 386 +public static class ZipStreamHelper { 387 + #region Compress and encode 388 + /// <summary> 389 + /// Comprimeer een string en geeft deze terug in Base64 string. 390 + /// </summary> 391 + /// <param name="content">filecontent</param> 392 + /// <returns>gecomprimeerde string</returns> 393 + public static string CompressToBase64String(string content) { 394 + //string to byte[] 395 + byte[] contentArray = stringToByteArray(content); 396 + // Compress 397 + byte[] compressed = Compress(contentArray); 398 + return base64_encode(compressed); 399 + } 400 + 401 + /// <summary> 402 + /// Zet een string om naar een ByteArray 403 + /// </summary> 404 + /// <param name="content">filecontent</param> 405 + /// <returns>ByteArray</returns> 406 + public static byte[] stringToByteArray(string content) { 407 + System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding(); 408 + return encoding.GetBytes(content); 409 + } 410 + 411 + /// <summary> 412 + /// comprimeer een ByteArray 413 + /// </summary> 414 + /// <param name="data">filedata als ByteArray</param> 415 + /// <returns>gecomprimeerde ByteArray</returns> 416 + public static byte[] Compress(byte[] data) { 417 + using(var compressedStream = new MemoryStream()) 418 + using(var zipStream = new GZipStream(compressedStream, CompressionMode.Compress)) { 419 + zipStream.Write(data, 0, data.Length); 420 + zipStream.Close(); 421 + return compressedStream.ToArray(); 422 + } 423 + } 424 + 425 + /// <summary> 426 + /// Zet een ByteArray om naar een Base64 string 427 + /// </summary> 428 + /// <param name="data">gecomprimeerde ByteArray</param> 429 + /// <returns>Base 64 string</returns> 430 + public static string base64_encode(byte[] data) { 431 + if (data == null) 432 + return string.Empty; 433 + return Convert.ToBase64String(data); 434 + } 435 + 436 + /// <summary> 437 + /// Zet een string om naar een Base64 string 438 + /// </summary> 439 + /// <param name="data">string</param> 440 + /// <returns>Base 64 string</returns> 441 + public static string string_base64_encode(string data) { 442 + if (string.IsNullOrEmpty(data)) 443 + return string.Empty; 444 + 445 + //string to byte[] 446 + byte[] contentArray = stringToByteArray(data); 447 + return base64_encode(contentArray); 448 + } 449 + #endregion 450 + 451 + #region Decompress and decode 452 + // Decode and decompress 453 + /// <summary> 454 + /// Decomprimeer een Base64 string naar een string 455 + /// </summary> 456 + /// <param name="contentBase64">GZIP Base64 string</param> 457 + /// <returns>string</returns> 458 + public static string DecompressBase64StringToString(string contentBase64) { 459 + // Decompress 460 + byte[] decoded = base64_decode(contentBase64); 461 + byte[] decompressed = Decompress(decoded); 462 + 463 + return byteArrayTostring(decompressed); 464 + } 465 + 466 + /// <summary> 467 + /// Zet een ByteArray om in een normale string 468 + /// </summary> 469 + /// <param name="data">ByteArray</param> 470 + /// <returns>string</returns> 471 + public static string byteArrayTostring(byte[] data) { 472 + System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding(); 473 + return enc.GetString(data); 474 + } 475 + 476 + /// <summary> 477 + /// Zet een Base64 string om naar een ByteArray 478 + /// </summary> 479 + /// <param name="encodedData">Base64 string</param> 480 + /// <returns>gecomprimeerde ByteArray</returns> 481 + public static byte[] base64_decode(string encodedData) { 482 + byte[] encodedDataAsBytes = Convert.FromBase64String(encodedData); 483 + return encodedDataAsBytes; 484 + } 485 + 486 + /// <summary> 487 + /// Zet een gecomprimeerde ByteArray om in een ByteArray 488 + /// </summary> 489 + /// <param name="data">gecomprimeerde ByteArray</param> 490 + /// <returns>ByteArray (gedecomprimeerd)</returns> 491 + public static byte[] Decompress(byte[] data) { 492 + using(var compressedStream = new MemoryStream(data)) 493 + using(var zipStream = new GZipStream(compressedStream, CompressionMode.Decompress)) 494 + using(var resultStream = new MemoryStream()) { 495 + var buffer = new byte[4096]; 496 + int read; 497 + 498 + while ((read = zipStream.Read(buffer, 0, buffer.Length)) > 0) { 499 + resultStream.Write(buffer, 0, read); 500 + } 501 + 502 + return resultStream.ToArray(); 503 + } 504 + } 505 + #endregion 506 +} 507 +{{/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 )))