Large Text from the Internet (>1024 Chars)
Achim_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
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
0
Comments
-
use stream and use function
WebClient.Response(Stream);0 -
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
Achim0 -
you are welcome.
if the response is an xml file, you can use msxmldom.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
