Discussion (6)3
Log in or sign up to continue

Post your isc.REST code.

Your web app config looks ok, but you need to check that:

  • UnknowUser is enabled
  • UnknownUser can access USER namespace (if it's a dev box just give him %ALL role)
  • License consumption is not 100%

My, isc.REST code at below. UnkownUser is enabled. I just  download Evaluation edition. Not,  production edition. So, just trial. Is it obstacle for it?

Include isc.REST

/// Class for REST-like web api.<br>
/// Logic related to request processing goes here.
Class isc.REST Extends isc.AbstractREST
{

XData UrlMap
{
<Routes>
   <!-- Test method-->
   <Route Url="/test" Method="GET" Call="Test"/>
   <Route Url="/logout" Method="GET" Call="Logout"/>
 </Routes>
}

/// End session
ClassMethod Logout() As %Status
{
#dim %session As %CSP.Session
set st = %session.Logout(1)
set %session.EndSession = 1
return st
}

/// Test method, outputs <b>%request</b>, <b>%response</b> and <b>%session</b> objects.
ClassMethod Test() As %Status
{
    write "{""Status"": ""OK""}"
    return $$$OK
}

}
 

I solved problem. But it also weird. When studio is open it returns "Service Unavailable" in browser, but when close studio it works OK.

So, it means that you don't have licence, and you have only one license unit available. You have activate licence to get it worked together.

Yes, sometimes the license restrictions that apply to evaluation of a downloaded copy of Cache (i.e. without having contacted InterSystems for a loan key) lead to opaque and unfortunate failures that may give the impression that the product isn't worth the effort.

if we can not allocate a license for a REST call/request we report a "503 Service unavailable" error by default.

Please note: Studio, Terminal and SMP allocates a license-slot. Every unauthenticated REST request will retain a license-slot for at least 10 sec. after request is finished.