We finished our last lesson with our Widgets Direct page iterating over a list of widgets, displaying an ID and a Name value. While we have been able to achieve this with only a small amount of coding, the page itself is not the most visually appealing place to be. The AngularJS framework is providing a powerful Model-View-Controller framework for our structure and logic, but it does not implement anything that will provide a nice UI experience.

6 3
0 1.6K

Hello.

The idea of this post is to introduce Frontier: An abstraction layer that allows Rapid REST development.

REQUIREMENTS:

Why?

Have you ever found yourself dealing with repetitive tasks like mounting objects, serializing them and eventually handling multiple errors for multiple cases? Frontier can boost your development by making you focus on what really matters: your application.

Frontier is made to stop you from WRITE'ing by instead forcing your methods to return values.
It's designed to make you code clean, and you'll see the why pretty soon.

This is the Part 1, where you'll learn he basics about how to work with Frontier. That means at the end of this part you should be capable of

creating GET requests without difficulties. Since this also serves as a way to introduce the framework, I'll be calling this part: Core concepts.

4 8
0 1.6K

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

Over the past year or so, my team (Application Services at InterSystems - tasked with building and maintaining many of our internal applications, and providing tools and best practices for other departmental applications) has embarked on a journey toward building Angular/REST-based user interfaces to existing applications originally built using CSP and/or Zen. This has presented an interesting challenge that may be familiar to many of you - building out new REST APIs to existing data models and business logic.

12 34
6 1.5K

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
Article
· Dec 7, 2017 3m read
Asynchronous REST

In this article I'd like to discuss asynchronous REST and approaches to implementing it.

Why do we need asynchronous REST? Simply put - answering the request takes too much time. While most requests usually can be satisfied immediately, some can't. The reasons are varied:

  • You need to perform time-consuming calculations
  • Performing action actually takes time (for example container creation)
  • etc.

The solution to these problems is asynchronous REST. Asynchronous REST works by separating request and real response. Here's an example, let's consider the following simple async REST broker:

3 9
0 1.5K
Article
· Sep 6, 2017 4m read
Polling an External REST API with Ensemble

Preface

Before we begin, I'd like to mention that I am by no means an Ensemble expert, so take this with a grain of salt and please feel free to offer any suggestions for improvement. That being said, I have enjoyed working with Ensemble and wanted to share the approach I took to poll an external REST API for patient data in the hopes that it might help others with a similar goal.

2 5
0 1.5K

or "Didn't you say you would cover Persistent Objects in Part 5, Chris?"

Yes, that was the plan. This is a pretty important topic, so it get's its own Article

Up until now, we've display widget JSON that has been created by a basic loop. Clearly this isn't of much value. Now we have our stack connected together, and we can see that the data is flowing to the Welcome page, it's time to complete the stack and start feeding our service from "real" data.

2 4
0 1.5K

Hi everybody,

I created my own REST service class by extending EnsLib.REST.Service.

In some particular conditions of the parameters of the request, the REST service should respond to the client with an HTTP status response code 400 "Bad request".

I read the article "RESTful Exception Handling " and I try to use the suggested:

do ..ReportHttpStatusCode(400)

But the server seems ignore it and get back to client the 500 http response code.

Any suggestions?

0 3
0 1.4K

Cross-origin Resource Sharing (CORS) is one of the basic security features built into browsers. CORS controls accessing resources from a HTML page in domains other than the original domain. It is particularly important for AJAX calls. Since RESTful services can be used as data provider to any AJAX call, you have to be able to control cross-origin access. By default services are not allowed to do CORS. You are going to learn how to enable it for Ensemble RESTful services.

3 0
0 1.4K
Question
· Sep 19, 2016
REST json payload

Hi-

This almost seems like a silly question, but I am new to REST services.

I have a rest service that has a method for adding records to my database.

<Route Url="/userdetails" Method="POST" Call="SaveUserDetails"/>

My REST client sends data using json in the body of the request. I have verified using debugging tools that the data is actually being sent.

On the server side in my SaveUserDetails method where do I find the json?

What is the proper way to serialize that json into an object?

0 2
0 1.3K

In this article I'll describe how to set up web services and/or REST services using EWD 3.

Since EWD 3 is designed to be modular, you can construct the environment that exactly meets your needs, but for much of the time you'll probably find that the pre-built EWD 3 ewd-xpress super-module does most of what you need because it hooks together all the core EWD 3 and other building-blocks you'll need:

4 1
1 1.3K

I am trying to write an application that will take some information on the database make a call to the Google API distance matrix and get the information to use with rest of the application without using the ensemble part of the development is this possible and how can I do my communication with the API from a cache class thanks in advance

0 7
0 1.3K

or "Things are going to break"

We left our application over the weekend, secure in the knowledge that it was returning data from our primary persistent class, User.Widget. However, Widgets Direct are the premier supplier of both Widgets AND Widget Accessories, so we should really start working on adding these Accessories to our application.

2 3
0 1.3K

Introduction

Nowadays, there is a lot of applications that are using Open Authorization framework (OAuth) to access resources from all kinds of services in a secure, reliable and efficient manner. InterSystems IRIS is already compatible with OAuth 2.0 framework, in fact, there is a great article in the community regarding OAuth 2.0 and InterSystems IRIS in the following link here.

5 1
0 1.2K

Hello,

I have a DB server (ser-app-db) where cache is installed as server.

I have a Web server (ser-app-w) where cache is installed as web server and configured as CSP gateway.

I followed the configuration guide (https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...) and ser-app-w perfectly display the CSP and CLS pages.

But that's not working for my REST service, for exemple with the REST sample:

0 9
0 1.2K