Large Text from the Internet (>1024 Chars)

Achim_63Achim_63 Member Posts: 3
Hallo everyone,

the text I want to receive is no XML, it ist Text like CSV.

Name DataType Subtype
WebClient Automation 'Microsoft WinHTTP Services, version 5.1'.WinHttpRequest


URLString := 'http://www.trendmicro.com/ftp/products/tsc/readme.txt'; (for example)
WebClient.Open('GET', URLString, FALSE);
WebClient.Send();


Getting the Text from WebClient.ResponseText runs into
Microsoft Dynamics NAV
The length of the text string exceeds the size of the string buffer.


Getting it from WebClient.ResponseBody gives me the whole data in a
binary format.

Does anyone know how to convert this data to text without writing it to the disk ?

Finally it should be placed in a BLOB to handle with BigText.

Thank You for your attention.
Achim

Comments

  • ara3nara3n Member Posts: 9,256
    use stream and use function

    WebClient.Response(Stream);
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Achim_63Achim_63 Member Posts: 3
    Thank You for your response.

    This is my solution:

    Name DataType Subtype Length
    InStream InStream
    OutChar Char
    OutInt Integer

    InStream := WebClient.ResponseStream;

    WHILE NOT InStream.EOS DO BEGIN
    OutInt := InStream.READ(OutChar,1);
    // to check every character
    END;

    CLEAR(WebClient); // Important ! to avoid the error message

    This solution works also with Textlines > 1024

    Regards
    Achim
  • ara3nara3n Member Posts: 9,256
    you are welcome.
    if the response is an xml file, you can use msxmldom.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.