Hi,
I am using the WinHttp Automation Server to send credit card processing info to a processor for authorization, etc. I just began testing today and all was looking good from a Navision standpoint. I was able to read the response to a Text variable 0f length 1024. However, my response was basically header info with blank for the data except for an error message as I was sending incorrect login info. Once I got my login info corrected, I tried again but my code blew up as soon as I tried to read the full(complete response info) WinHttp.Responsetext into my text variable saying that I had exceeded the length of the string buffer. I then tried everything else I could thing of :BigText, BLOB, files all with INSTREAM but had no success with anything. I have searched the forum extensively and admit that the results were not encouraging. However, I wanted to ask once more before I began searching for alternative methods whether that involves writing my own automation object or whatever. Can anyone help with this problem?
Thanks in advance,
Jack
Jack Littlejohn
Clemson, SC
0
Answers
The buffer error is a limitation of NAV interface to automation.
You need to use Stream instead. Do not use Responsetext function but Response.
Is the response an xml file?
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I did continue to try streaming both WinHttp.ResponseString and WinHttp.ResponseBody into a BLOB field with the following code:
CCJnl.Response.CREATEINSTREAM(instr);
int := instr.READ(WinHttp.ResponseStream);
However the response stream threw the following error:
"You are using an invalid data type for this function"
I have some limited experience with INSTREAM and OUTSTREAM but none with WinHttp until this effort. Am I making an obvious stupid mistake?
Thanks,
Jack
Clemson, SC
Clemson, SC
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I am facing a similar situation where I am trying to read the data from WinHttp.GetAllResponseHeaders() and would like to store it as a file. This function doesnt allow the response to be streamed nor could be assigned to bigtext.
Any possible workarounds ?
|To-Increase|
How do I iterate over the responseheaders ? Do you mean using GetResponseheader()
I am facing the below issue when I do that
http://www.autoitscript.com/forum/topic/80855-help-with-winhttpwinhttprequest-object/