Hello,
We use AntView 2 in a 32-bit Visual FoxPro Advanced application to browse Spain’s Public Sector Procurement Platform and download the XML documents associated with procurement notices.
We are investigating intermittent server rejections. We would like to confirm that we are using AntView’s browser session correctly and whether there is a more appropriate way to download these documents through the control.
ENVIRONMENT
- 32-bit Visual FoxPro Advanced. Reported version: Visual FoxPro 10.00.0000.2508.
- ActiveX control: AntViewAx2.AntView.
- Document interface: AntViewAx2.AntViewDocument.
- User-Agent observed in AntView:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/156.0.0.0 Safari/537.36 Edg/156.0.0.0
HOW THE APPLICATION WORKS
We first navigate to the procurement notice’s detail page using AntView. We associate the document object with the browser:
m.oDocument.CurrentBrowser = m.oBrowser
We then extract the “XML document” link from the page’s DOM. It points to an endpoint such as:
https://contrataciondelestado.es/FileSys...ntIdParam=...
To download the XML within the browser session, we execute JavaScript through RunAnonymousFunctionSync. The function starts an asynchronous fetch and immediately returns a “started” indicator. We then poll its status through subsequent calls to RunAnonymousFunctionSync.
OBSERVED PROBLEM
Initially, valid XML documents are downloaded. At some point, the document endpoint starts returning HTTP 200, but the response body is an HTML page titled “Request Rejected”, rather than XML.
The page contains:
The requested URL was rejected. Please consult with your administrator.
Your support ID is: <numeric identifier>
Passing this HTML to the XML parser produces an error equivalent to:
A name started with an invalid character.
Line 1, position 157.
We confirmed that the parsing error is caused by the numeric support identifier enclosed in < and > in the rejection page.
The procurement detail page remains accessible while the document download fails.
Our application makes an initial attempt followed by up to three retries, with one second between retries. If all four attempts fail, it logs the error and continues with the next notice. There is no additional deliberate delay between notices; they are processed sequentially.
TESTS PERFORMED
1. Direct download using MSXML2.ServerXMLHTTP.6.0, with a Chrome User-Agent header.
2. Download through fetch within the AntView session, using credentials: 'include'.
3. Closely timed comparisons of both methods against the same XML URL.
4. Tests from a new VFPA process and a fresh AntView session that first navigates to the detail page.
5. Verification that the rejected URLs are exactly the same URLs that previously returned valid XML.
Results on 5 November 2026, Madrid local time (UTC+1):
- At 12:31:10, both AntView and ServerXMLHTTP successfully downloaded the same document. The saved files had identical hashes.
- In a subsequent download run using AntView, 19 XML documents were retrieved successfully. Rejections began with notice 20, and subsequent documents also started failing.
- At 12:43:04–12:43:05, we repeated the comparison while the rejection was occurring. Both AntView and ServerXMLHTTP returned HTTP 200 with a “Request Rejected” HTML body. AntView received 245 characters and ServerXMLHTTP received 244.
We have also observed the rejection when manually opening the XML link in another browser. Therefore, we are not attributing the problem to AntView, and we have not established that bot detection is the specific cause. A server-side filtering rule may be involved, but we do not know which one.
QUESTIONS
1. Is this a correct use of RunAnonymousFunctionSync to start an asynchronous fetch and subsequently poll its result?
2. Does a fetch executed this way use the same session, cookies and network context as navigation within that AntView control?
3. Are there relevant differences between downloading through fetch and clicking the document link, particularly regarding cookies, redirects, Referer and navigation-related headers?
4. Would you recommend a particular AntView API or event for downloading the document and retrieving its bytes while preserving the browser context?
5. How can we capture the actual request and response headers, redirects and network events through AntView to compare a successful request with a rejected one?
6. What additional AntView/WebView2 version or configuration information would you need to investigate this case?
Our aim is to verify that we are using the control correctly and collect diagnostic information that we can also submit to the procurement platform’s support team, if necessary.
We can provide a minimal Visual FoxPro example, an affected public URL, response bodies and timestamped logs. We would exclude cookies and other session data from any shared files.
Thank you for your assistance.
Best regards,
Carlos Yohn
A.G.P. S.L.
moderator edit: moved all text out of the code section as it was particularly hard to read that way.
We use AntView 2 in a 32-bit Visual FoxPro Advanced application to browse Spain’s Public Sector Procurement Platform and download the XML documents associated with procurement notices.
We are investigating intermittent server rejections. We would like to confirm that we are using AntView’s browser session correctly and whether there is a more appropriate way to download these documents through the control.
ENVIRONMENT
- 32-bit Visual FoxPro Advanced. Reported version: Visual FoxPro 10.00.0000.2508.
- ActiveX control: AntViewAx2.AntView.
- Document interface: AntViewAx2.AntViewDocument.
- User-Agent observed in AntView:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/156.0.0.0 Safari/537.36 Edg/156.0.0.0
HOW THE APPLICATION WORKS
We first navigate to the procurement notice’s detail page using AntView. We associate the document object with the browser:
m.oDocument.CurrentBrowser = m.oBrowser
We then extract the “XML document” link from the page’s DOM. It points to an endpoint such as:
https://contrataciondelestado.es/FileSys...ntIdParam=...
To download the XML within the browser session, we execute JavaScript through RunAnonymousFunctionSync. The function starts an asynchronous fetch and immediately returns a “started” indicator. We then poll its status through subsequent calls to RunAnonymousFunctionSync.
OBSERVED PROBLEM
Initially, valid XML documents are downloaded. At some point, the document endpoint starts returning HTTP 200, but the response body is an HTML page titled “Request Rejected”, rather than XML.
The page contains:
The requested URL was rejected. Please consult with your administrator.
Your support ID is: <numeric identifier>
Passing this HTML to the XML parser produces an error equivalent to:
A name started with an invalid character.
Line 1, position 157.
We confirmed that the parsing error is caused by the numeric support identifier enclosed in < and > in the rejection page.
The procurement detail page remains accessible while the document download fails.
Our application makes an initial attempt followed by up to three retries, with one second between retries. If all four attempts fail, it logs the error and continues with the next notice. There is no additional deliberate delay between notices; they are processed sequentially.
TESTS PERFORMED
1. Direct download using MSXML2.ServerXMLHTTP.6.0, with a Chrome User-Agent header.
2. Download through fetch within the AntView session, using credentials: 'include'.
3. Closely timed comparisons of both methods against the same XML URL.
4. Tests from a new VFPA process and a fresh AntView session that first navigates to the detail page.
5. Verification that the rejected URLs are exactly the same URLs that previously returned valid XML.
Results on 5 November 2026, Madrid local time (UTC+1):
- At 12:31:10, both AntView and ServerXMLHTTP successfully downloaded the same document. The saved files had identical hashes.
- In a subsequent download run using AntView, 19 XML documents were retrieved successfully. Rejections began with notice 20, and subsequent documents also started failing.
- At 12:43:04–12:43:05, we repeated the comparison while the rejection was occurring. Both AntView and ServerXMLHTTP returned HTTP 200 with a “Request Rejected” HTML body. AntView received 245 characters and ServerXMLHTTP received 244.
We have also observed the rejection when manually opening the XML link in another browser. Therefore, we are not attributing the problem to AntView, and we have not established that bot detection is the specific cause. A server-side filtering rule may be involved, but we do not know which one.
QUESTIONS
1. Is this a correct use of RunAnonymousFunctionSync to start an asynchronous fetch and subsequently poll its result?
2. Does a fetch executed this way use the same session, cookies and network context as navigation within that AntView control?
3. Are there relevant differences between downloading through fetch and clicking the document link, particularly regarding cookies, redirects, Referer and navigation-related headers?
4. Would you recommend a particular AntView API or event for downloading the document and retrieving its bytes while preserving the browser context?
5. How can we capture the actual request and response headers, redirects and network events through AntView to compare a successful request with a rejected one?
6. What additional AntView/WebView2 version or configuration information would you need to investigate this case?
Our aim is to verify that we are using the control correctly and collect diagnostic information that we can also submit to the procurement platform’s support team, if necessary.
We can provide a minimal Visual FoxPro example, an affected public URL, response bodies and timestamped logs. We would exclude cookies and other session data from any shared files.
Thank you for your assistance.
Best regards,
Carlos Yohn
A.G.P. S.L.
moderator edit: moved all text out of the code section as it was particularly hard to read that way.
CYZ


![[+]](https://forums.antwise.com/images/collapse_collapsed.png)