Question Sarvan Ibishov · Jan 31, 2018

Service Unavailable while invoke rest url

Hi. I am learning create Rest service  with Cache. From this repo. https://github.com/intersystems-ru/REST

I created new web application from Web Applications  section in Management Portal. Such as screenshot.  In browser  call http://127.0.0.1:57772/rest/test . But got  "Service Unavailable" 503 response.  Could you please help?

Comments

Eduard Lebedyuk · Jan 31, 2018

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%
0
Sarvan Ibishov  Feb 1, 2018 to Eduard Lebedyuk

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
}
}
 

0
Sarvan Ibishov  Feb 1, 2018 to Sarvan Ibishov

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

0
Dmitry Maslennikov  Feb 1, 2018 to Sarvan Ibishov

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.

0
John Murray  Feb 1, 2018 to Dmitry Maslennikov

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.

0
Bernd Mueller · Feb 1, 2018

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.

0