Question
· Jun 21, 2016

How to enable a new web service?

I'm following the tutorial here.  When I try to call the default Test() method I get the following error:

An error occurred with the CSP application and has been logged to system error log (^ERRORS)

I found this document which says I need to make the "Web Application" accessible by running a couple commands.  I'm not even sure I created a Web Application.  Regardless, I tried a few variants but still get the same error.

Here is the URL for the Service Catalog: /csp/healthshare/mhclib/Custom.MHC.Scott.ServiceTest.cls

I tried different things including these two:

set ^SYS("Security","CSP","AllowClass","/csp/healthshare/mhclib/Custom.MHC.Scott.ServiceTest/","%SOAP.WebServiceInfo")=1
set ^SYS("Security","CSP","AllowClass","/csp/healthshare/mhclib/Custom.MHC.Scott.ServiceTest/","%SOAP.WebServiceInvoke")=1

 

No dice.  What am I missing? It's literally the default code from the Web Service wizard.

Discussion (5)0
Log in or sign up to continue

Message
"An error occurred with the CSP application and has been logged to system error log (^ERRORS)"

means that you can check error in Management Portal -> System Operation -> System Logs -> Application Error Log -> [Namespace]

Or for debugging purposes set error page for web application to %CSP.Error.cls
http://docs.intersystems.com/cache20161/csp/docbook/DocBook.UI.Page.cls?...

and see errors on the page itself

Yes, Illegal CSP Request usually means that access to this particular class is prohibited.

If your web application named '/csp/healthshare/mhclib/' then you need to enable classes as follows:

set ^SYS("Security","CSP","AllowClass","/csp/healthshare/mhclib/","%SOAP.WebServiceInfo")=1
set ^SYS("Security","CSP","AllowClass","/csp/healthshare/mhclib/","%SOAP.WebServiceInvoke")=1

Notice that calling SOAP Service via test webpage (%SOAP.WebServiceInvoke.cls) is independent from calling web service via SOAP protocol. For that you should check option "Inbound Web Services" in Web application settings.

%SOAP.WebServiceInfo and %SOAP.WebServiceInvoke are just pages to test web services via Browser.

SOAP protocol itself does not use these pages.