Reading large txt from WinHttp.ResponseText Property
jelittlejohn
Member Posts: 61
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
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
Clemson, SC
0
Answers
-
I suggest to use MSXML 6.0 instead of winhttp. more specifically xmlhttpserver
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?0 -
Had no luck using MSXML 6.0 instead of WinHttp as my send statement return an error.
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,
JackJack Littlejohn
Clemson, SC0 -
How about using the ResponseStream method to create an InStream and then read this into a BigText variable:
InStr := WinHTTP.ResponseStream; BigTxt.READ(Instr);
0 -
Thank You! I was able to read the responsestream into a BigText variable using this method. =D> I had thought I was going to have to try to create a custom automation object for awhile there but was trying desperately to avoid that so I wouldn't have to install it on all client machines. I was able to write the bigtext variable to a file for viewing so now I'm back to figuring out what the codes I received back mean. Thanks again!!Jack Littlejohn
Clemson, SC0 -
[Topic moved from 'NAV 2009' forum to 'NAV/Navision' forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hi
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 ?Guna0 -
iterate over the responseheaders and use the winhttp.responsestream to append the bigtext?0
-
Hi Sog
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/Guna0
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
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 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
