What's a CSP service? A REST service?
- Log in to post comments
What's a CSP service? A REST service?
What do you want to achieve?
What are the triggers for a session closure?
If that is indeed the case I recommend this series of articles.
Try
set DynObj={}.%FromJSON(filename)What's Quality area?
It's not a server who checks for expiry, but a client. So your flow works like this:
1. 15:00 calling application runs a GET request for patient?MRN=A
2. 15:00 CSP Web application calls HIHLib.REST.Server class and forwards request on to namespace for handling (via business services,process and operations)
3. 15:00:05 response is returned with EXPIRES 300 and VaryByParam set to *
4. 15:10 a seperate internall process results in patient with MRN A - first name changed from pete to bob
5. 15:12 calling application runs a GET request for patient?MRN=A
6. 15:12 web browser (on a client side) sees that patient?MRN=A request is cached locally and still valid due to EXPIRES 300. Web browser is returning a cached value to a calling application without going to the server.
And server would never get a second request (that's the point of the EXPIRING header after all).
Expires controls how long the response is valid. It's for things like HTML pages which are static.
If you think that a response can change every time a client requests it, you should not add an EXPIRING header.
Sorry, meant:
Do ..Adapter.%Client.SetHttpHeader(name, value)Call:
set sc = ..Adapter.SetHttpHeader(name, value)Calling @Benjamin De Boe
If you want to know if a compiled class exists, call:
write $$$comClassDefined(class)It, however, does not answer the question of a compiled version being current.
Depends on what WS expects, really.
SELECT 1How about a slightly different architecture:
Requests - and from Data Source namespace add 1 row to it on every new message.Ack which contains {RequestId, Namespace, State}Requests/Ack tables to get new unprocessed requests (no corresponding Ack record).Ack record and send a message in a local namespace for BP processingAdvantage of this architecture is that you decouple processing on a namespace level - so if a production in one namespace is in error state/down the rest can proceed. It also eliminates a single point of failure in namespace switching job.
tl;dr instead of pushing your event make consumers pull it whenever convenient.
Supply them in $horolog format. In a case of YYYY-MM-DD, try: $zdateh("YYYY-MM-DD", 3)
You can also just call:
set jsoninput = {}.%FromJSON(dir)where dir is a filename.
Use any of the Binary streams:
To send a stream just fill EntityBody property of a request object by calling it's CopyFrom method.
Interoperability (ex. Ensemble) can be used to both import data into InterSystems Data Platforms and push it to external systems.
OnHandleCorsRequest is called automatically if a browser requests CORS.
To add to original answer a bit:
Do %response.SetHeader("Access-Control-Allow-Origin","*")This is OK for development but for production use you need to replace * with a hostname of your web site.
Check this article. You'll need either HTTP Debugging proxy or Packet analyzer to debug this.
pResponse.physicianFirstNameYou probably have a mismatched brackets somewhere.
You can also try
[].%FromJSONinstead of
{}.%FromJSONYour code has a bracket at the end:
.png)
You might have erased it accidentally?
If you're sure that there's only one object in response array, replace:
Set tSC = pResponse.%JSONImport(tHttpResponse.Data.Read())with:
Set tSC = pResponse.%JSONImport({}.%FromJSON(tHttpResponse.Data).%Get(0)) It would parse your JSON stream into a dynamic JSON array (via {}.%FromJSON(tHttpResponse.Data)), get zeroth element from it (via %Get(0)), and pass it for JSON import (via pResponse.%JSONImport).
If you're sure that there's only one object in response, replace:
Set tSC = pResponse.%JSONImport(tHttpResponse.Data.Read())with:
Set tSC = pResponse.%JSONImport({}.%FromJSON(tHttpResponse.Data).%Get(0)) If you want to parse an entire array, you'll need another class:
Class CDSM.ProviderAPI.Responses Extends (%Persistent, %JSON.Adaptor) {
Property Responses As List Of CDSM.ProviderAPI.ProviderInfo;
}And in this case replace this code:
Set pResponse=##class(CDSM.ProviderAPI.Response).%New()
Set tSC = pResponse.%JSONImport(tHttpResponse.Data.Read())With:
Set pResponse=##class(CDSM.ProviderAPI.Responses).%New()
Set tSC = pResponse.%JSONImport(tHttpResponse.Data)and update the method signature too.
Why would be better or recommended to use %CSP.REST directly, instead of EnsLib.REST.Service?
To start with using %CSP.REST is the recommended way to use REST with productions.
Are there any improvements if we use %CSP.REST?
It's easier to develop, there are more examples available, you can have a combined production/non-production REST services easily.
The first, but not the last one, so still not getting the idea of having this intermediate upgrade point.
Sure, but you can start freezing on 2016.2. There's no point in freezing if you jump to latest version from pre 2016.2
Sorry, on which topic? Everyone knows that Cache/IRIS never runs on an unsupported OS.
Upgrade path between Cache/IRIS versions where OS for old and new Cache/IRIS versions must be different.