I need to pass a parameter string that contains slashes to a REST call.

I tried URL encoding, or making URL map to accept query parameter instead of path parameter but apparently we only allow for path parameters.

I can come with several workarounds, but these involve some transformation at client and then on server, but I'd prefer a direct support.

Q1: is there any Cache specific trick to pass slashes in path parameters

Q2: are we going to support query parameters in REST?

something like this would help:

0 18
0 43.4K

Hi everyone,

This is:

Cache for UNIX (Red Hat Enterprise Linux for x86-64) 2016.2 (Build 736U) Fri Sep 30 2016 12:25:56 EDT

The server is on RedHat Linux while the browser is running on Windows (Firefox).

I am helping a partner build a complex modern HTML5 web application that talks with Caché using REST calls. They have been using %CSP.REST very successfully. Security works great as well.

1 11
0 9.2K

Hi-

Im curious if there is any specific configuration that has to be done on an IIS web server to serve up RESTful web services.

I have a server that has IIS installed, with the CSP gateway. a second server that has Cache installed on it.

I have configured a web application using the Cache System Management Portal for the web services that has a dispatch class pointing to my dispatch class.

I have created an application mapping in my CSP Gateway Management Portal on the web server such that url's with /webservices prefix are routed to my cache server.

0 1
0 3.5K

Hi dev community,

I am currently working on a project to send documents to a RESTful based API that supports bearer
Token Authorization.

When we try to fire a JSON request from our EnsLib.Rest.Operation towards the 3rd party API with a
valid Token we keep receiving Authorization Error codes HTTP 401 back.

If we use the same request and same Token from a test utility such as Postman the request is
successful and we are able to move past the authorization stage.

0 4
2 3.5K
Question
· Jul 17, 2017
Connecting to a web service

Hi,

I am new to coding web services and trying to connect to an API that returns its format in xml or json.

I have a class as follows.. when I run I get back a 6059 in my status - Unable to open TCP/IP socket to server

Can someone help me identify what I am missing? Thanks

0 12
0 2.7K
Question
· Apr 11, 2017
Authentication with REST

We are building a bunch of rest based services using Ens 2016.2 to serve our browser based application (Angular 4).

Two questions:

1. The initial authentication seems only work if credentials are placed in the url parameters. Trying to use the Authorization header instead, the client code immediately complains about Access-Control-Allow-Origin. How can I resolve this?

2. After initial authentication, what is the proper way to send subsequent rest calls without having to include credential every time?

2 7
0 2.6K
Question
· Oct 12, 2019
How do you search with REST

The question is pretty much in title. I'm developing a REST API, it has a search endpoint with 10 optional parameters. How do I pass them and stay RESTFul?

To ease the question a bit let's agree that:

  • all parameters are AND parameters, user can't make combos, ORs, etc. User can only provide values
  • all values are integers so I don't have to think about URL limits
  • all values are atomic
  • all conditions are about equivalency

Some options I know of:

1. URL parameters.

0 9
0 2.5K
404 Not Found

{
"error": {
 "errors": [
  {
   "domain": "global",
   "reason": "notFound",
   "message": "Not Found"
  }
 ],
 "code": 404,
 "message": "Not Found"
 }
}

I want to do something like the above sample from a Google Storage JSON API. I have a call to Write obj.%ToJSON() followed by return ..ReportHttpStatusCode(..#HTTP404NOTFOUND) however the HTTP Status code is always 200. If I remove the Write obj.%ToJSON() statement it returns a 404 status with no body. How do I return both?

0 1
0 2.5K
Question
· Jan 12, 2018
HTTP Response parsing error

Hello

I'm in the process of creating a TestClass which simulate a HTTP POST call to REST-based web
services and while I am having success, I'm struggling on how to parse out the results to a JSON
format

Here is down the code part which concerns parsing the HttpResponse.Data variable into JSON :

0 3
0 2.1K

Hello community,

I am trying to parse the below HttpResponse in Cache. Cannot get the Iterator to work. Is there a single loop which can parse both or single messages and grab the error?

{
error:[
{ txt1:'error msg1'},

{ txt2:'error msg2'},
]
}

{
error: {
txt1:[
'error msg1',

'error msg2'
]
}

Thanks,

Jimmy Christian

0 16
0 2.1K

I cant find any description on how to read custom http request headers in a REST service.

On some occations i want to read http headers passed along when customers uses our REST API or headers added by the CND provider. Does anyone know how to read these http headers?

For example:
cloudflair.com sends a vistors country information along to the server using a customer http header called "CF-IPCountry". We would like to read this information and use it for statistics.

0 3
0 1.8K
Question
· Jul 31, 2017
Posting to a REST service

Hello,

I come from a programming background, but haven't touched ObjectScript before my current job, so please forgive my ignorance.

Within an Ensemble system, I need to post some information to a RESTful web service. I'm just trying to figure out how to create a method which takes a simple message and posts this off to a RESTful web service?

Thanks in advance for any help.

0 3
0 1.8K

Hello,

In all web services, i need to my get login and token. So with Postman, i tried to call a HTTP request where I put the login/token in the header :

I tried to get data from Http request header. The REST APi use %CSP.REST. I tried something like that :

But it didn't work..

Someone can give me some example or other method ?

Regards,

0 2
0 1.6K

Hi,

I'm getting mad trying to get data from an external REST service that uses Basic Authentication from Ensemble. The BO worked fine when I was using a test server without authentification, but as soon as we need to go to production I cannot have it working.

So far, I've created the username/password at the credentials page (Ensemble-Configure-Credentials). I've setup the BO to use this credentials. But nothing happens.

I've tried with the Rest Client (addon for Mozilla), and using the same address, port and user/pwd works just fine.

0 8
0 1.5K