I'm trying to setup a REST server with CORS support. I have created a class that handles a specific part of the service (printer control). This class I have referenced in my main REST class by adding <Map Prefix="/print" Forward="myClass.PrintAPI" />

My main class does have its own <Route>s and handles CORS requests perfectly. But in my subclass OnHandleCorsRequest() is only run when requesting from same origin and never run when making a CORS request. I have set Parameter HandleCorsRequest = "true" in both my main REST class and the subclass.

0 4
1 318
Question
· Nov 5, 2021
ERROR #9406

I'm trying to send a POST request to my REST API and I'm getting this error and most likely due the lack of experience, I have no idea how to fix this issue:

"error": "ERROR #9406: Unexpected format for value of field, AlertText, using class base mapping",

"id": "JSONImportError",

"params": [

"AlertText",

"class base"

]

Am I missing something from my string definition?

Defined below as:

0 4
0 317

FIrst of all thank you for your time in reading this question and writing a response,

We would need some help,

-> Our objective is to control which method is being used in the service: GET POST PUT

We have tried to understand the example REST Service: Demo.REST.DirectoryService

After that we have tried to create our own custom rest service,

please take a few minutes to examine the following code:

0 12
0 315

After installing IRIS 2023.1 on a live copy of our production machine our REST Service now consumes a CSP Session with every request. The request is handled as expected, but uses one of the 5 CSP Session per license. So after 25 requests, the license is used up. The Grace time always shows 0 and the session stay for very long. (Maybe the 900 Seconds timeout).
On Caché 2018, we had the same settings for the Webapp and there, only a single Session was set for all requests. The Caché request didn't use any cookies.

0 7
0 310

Hi,

I don't found how to get params send by a GET REST query (not in url but by request param).

this is config of the call in postman

I try to get %request.Data, doesn't work : Data is undefined

I try to get %request.GetCgiEnv("Data"), doesn't work, return ""

I do ZW %request and see that my parameter is present in cgi parameters, but I don't now how to access it.

0 9
2 308

I have successfully created REST service classes on my local IRIS server following this book: Using the /api/mgmnt/ Service | Creating REST Services | InterSystems IRIS Data Platform 2021.2

I am now 1) trying to edit impl.cls in VS Code and 2) export it to my local repo so I can push to the remote repo.

When I click on my project in VS Code and 'Add to project' and choose the new package, spec.cls and impl.cls, I get the following error:

0 12
0 293

I am writing an API that sends over a very large JSON object.

The code I'm using to get the data is actually used in our production system today for the use of writing a report.

However when I call the code using the API (using SoapUI) I am getting 'Error getting response; java.net.SocketTimeoutException: Read timed out'

The web applications settings have a session timeout setting at 15 minutes, but this is timing out within just a few minutes, so I know it's not hitting this mark.

0 3
0 284

Hello everyone!
I have to build a REST service that receives a POST HTTP-request, collect a file from that request in the Form data and then send it in another HTTP Post request through Form Data. However I can't really seem to send the file, and I do not know where it has gone wrong. All I am getting told is that no file is being received from my HTTP Post request. I am reaching the REST Service I am supposed to send the request to, but nothing is being sent.

0 6
0 282

Hi everyone - In IRIS we would like to arrange the access of two users in such a way that each has access to exactly one (his) database only. Which resource does this (%DB_%DEFAULT allows each of the two users access to both databases). If you create new resources (%DB_Database1 and %DB_Database2) and then add them to individual roles (each for the user to), the access for the users, for example, via a REST client does not give the desired separation (instead once Ok, other database 401 Unauthorized both OK).

0 2
0 281

I have an interoperability production that functions as a FHIR proxy. I have a need to add an HTTP Header value to the outbound request. I've subclassed HS.FHIRServer.Interop.HTTPOperation, but I cannot find a way to add an HTTP Header to the request. The HTTP class used in HS.FHIRServer.Interop.HTTPOperation is HS.FHIRServer.RestClient.HTTP. That RestClient class does not seem to expose or allow modification of the actual HttpRequest.

0 3
0 278

What are other's thoughts, opinions and experiences going from CSP to RESTful services, specifically when it comes to reusing code in CSP files?

One could define a method in CSP as follows:

<script language="cache" method="SubmitSomethingAwesome" arguments="aswesomeId:%Numeric">

And it's generated in csp.mycsppage.cls ascsp.mycsppage.SubmitSomethingAwesome(awesomeId as %Numeric).

Have people had success defining there rest call by calling the generated CSP classmethod?

Things that work well I've found:

0 3
0 275

Hi Developers!

I stuck with one interesting problem.

For example, let's use this template repo. If you build this container A using docker-compose and then run the container it exposes REST-API which is available on:

localhost:52773/person/all

The question is how to make this REST-API accessible from another docker container B running on the same machine? E.g. with IRIS 2019.4 Community from this repo?

The problem is that for the second container localhost it's something which belongs to container B.

I think I need to set up a network between containers somehow. E.g. using docker-compose. But is there any simpler way?

0 2
0 264

When manually coding REST services and using GET /api/mgmnt/v1/:namespace/spec/:application/ to return an OpenAPI spec, how do you specify supported properties (OpenAPI Properties in Use | Creating REST Services | InterSystems IRIS Data Platform 2021.1) like responses, definitions, and information in paths like summary and description?

0 7
1 257

Hello Team,

please can someone help me in the below.

I'm trying to call a Rest API below specification working in postman, and receiving perfectly the response:

POST /PharmacyServices/api/Pharmacy/Upload?Key=aaaa&Username=bbb&Password=ccc HTTP/1.1
Host: abc:38440
Content-Length: 240
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="File"; filename="///xxxx/POC/CSV/20230607.csv"
Content-Type: text/csv

1 1
0 253

Hi,

I've added a REST service which worked fine on our test system but failed on the production environment because UnknownUser does not have %All set and I really don't want it set on production (in fact I've also switched it off on test).

Is there a way to allow a single REST service to have unauthorised access?

I was thinking adding a resource/role to UnknownUser specifically for that service but I've never touched on Users/Roles/Resources so I'm struggling to work out what needs adding where.

Thanks

0 2
0 252