Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

SRP_Com returns status 0

After we upgraded our SRP Utilities to version 2.0.2, we have code that uses SRP_Com that isn't working anymore. Previously it would return status 200, but now it returns 0. When we open the URL in the browser, it works fine.

I created this test code so you can verify.

// This returns status 0
URL = "https://www.google.com"
res = srp_com(api,'CREATE','MSXML2.XMLHTTP')
res = srp_com(api,'CALL',"Open", "GET", URL, 0)
res = srp_com(api,'CALL',"Send")
status = srp_com(api,'GET','Status')
if status eq 200 then
// Do stuff
end



// This returns status 200
oHTTP = Olecreateinstance("MSXML2.XMLHTTP")

cres = Olecallmethod(oHTTP,"Open","GET", Url,0)
res = Olecallmethod(oHTTP,"Send" )
status = Olegetproperty(oHTTP, "Status")


Comments

  • A few responses to this. First, we highly recommend that you check the ERROR status after each call to SRP_COM. This will help you identify the root of your problem. I was able to replicate your issue, but the problem originated in the "Open" method. When I changed this to all lower case, it works. This then created an error with the "Send" method and then the "Status" method. Changing them all to lower case solved the problem. However, I agree that this is a bug since the docs for the XMLHTTP object suggest the names are in title case. We'll take a look at this and let you know.
  • This was indeed just an issue of SRP_COM looking for property and method names case-sensitively. RDK 2.0.2 RC2 will now look these up case-insensitively, and it fixes your SRP_ARRAY issue as well.
Sign In or Register to comment.