Skip to Content
-1
Jun 12, 2018 at 09:55 PM

CL_HTTP_CLIENT returns javascript code

218 Views

Hi,

My ABAP program is using CL_HTTP_CLIENT to read currency rates off a banks HTTP webpage. It's a simple read on a public facing website that returns data in XML format, no logging in or anything is required. Sometimes the data is read correctly but seemingly randomly, this javascript code below is returned instead:

 <HTML><HEAD><META HTTP-EQUIV="Refresh" CONTENT="0"><SCRIPT Language="JavaScript">var coupon1= 23432;var coupon2= 23432;var style1= 21154;var style2= 123432;var add =coupon1+coupon2+style1+style2;document.cookie="MTD_EPTQ="+add+";path=/";window.location=window.location.href;window.focus();</SCRIPT></HEAD></HTML>

What is also strange is I have the same program scheduled to run at the same time on another system, and that would read the webpage OK. The currencies are updated hours before the ABAP program is run so I know they aren't being updated by the bank at that time. My expertise is ABAP not this web stuff so I am confused as to what could be happening. Any help would be appreciated, thanks!

Thks,
sapmanie