Hello!
We are trying to retrieve some information from a webservice in our Navision 5 system. Therefore, we use the OCX "Microsoft Internet Transfer Control 6.0" and do a GET request from a URL.
As an answer, we receive a string of text. This text can be bigger then 1024 digits - so we can not work with a normal text variable when assigning the return value like this:
Result:= MIT.OpenURL(ServiceURL);
Due to that, we want to use the type BigText, which should be big enough. The problem is, that it doesnt work - the text is not assigned. When we assign it like this:
Result.ADDTEXT(MIT.OpenURL(ServiceURL));
and afterwards check the length of the variable, it is always 0.
MESSAGE(FORMAT(Result.LENGTH));
Is there any difference regarding what values can be assigned? Or do you think of any other possiblity? I already tried writing the result directly into a text file - this can also only be 1024 digits at a time. I also wasn't able to do it with a blob field..
If you know what I did wrong, or have any idea how to handle it otherwise, I would be happy for any help.
Thanks for any input,
kola1
0
Answers
I guess very the same reason caused the 'direct' write to a file to be limited to 1024 characters.
You need to find a method to pass a file name or a stream to the OCX component, and make the component to write directly to the stream or a file - without passing the data through NAV.
Any code structure like Result.ADDTEXT(MIT.OpenURL(ServiceURL)) constitutes passing the data through NAV. Any construct like this will be subject to maximum NAV text limit.
If your OCX doesn't have any methods where you can pass the file name (or a stream) as a destination of OpenURL you may be forced to use some different component. I believe you may be able to find examples here on mibuso of using some automation components to handle http requests
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03