Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

REST

Blog posts for the tag #REST
30-Nov-2017
Jersey JAX-RS filters and interceptors execution order when throwing Exceptions
Previously I wrote a post about using a custom exception mapper in your RESTful service with Jersey. This article looks at the execution order of all of the filters, interceptors, readers and writers that get called along the way in this scenario.
23-Nov-2017
How to fix Postman error - Failed to import data: format not recognized
Postman is a great tool for testing your RESTful services but sometimes it just doesn't play nice. If you're trying to import a WADL generated by WebLogic you will come across this error - "Failed to import data: format not recognized". WebLogic is not doing anything wrong in this case and the problem lies with Postman.
09-Nov-2017
A custom exception mapper and writer for a RESTful JAX-RS Jersey service
I've written quite a few articles about Jersey already ranging from filter and interceptor execution order to a custom message body reader implementation. This article delves deeper into Jersey and looks at how to gracefully handle exceptions by using an exception mapper and entity writer to convert a caught exception to output from your service.
02-Nov-2017
Jersey JAX-RS filters and interceptors execution order for a POST request
This is a follow on article from Jersey JAX-RS filters and interceptors execution order for a simple GET request. This time instead of a GET request I'll be looking at a POST request.
26-Oct-2017
Writing a custom MessageBodyReader to process POST body data with Jersey
Jersey makes it really easy to customise how your RESTful service accepts input and how it produces output. I've written previously about how, with a few lines of code it's possible to use Jackson to convert your POJOs to JSON when returning data from your service. This article looks at the other end of the lifecycle - the input, specifically how a JAX-RS service can process a POST message body and create a POJO as input to a Resource method parameter. In other words - how do you implement a custom message body reader?
19-Oct-2017
Jersey JAX-RS filters and interceptors execution order for a simple GET request
I've written about Jersey on a number of occasions in the past. During my time working with Jersey I always found that there weren't good resources available that showed the data flow and invocation order of filters and interceptors while processing a request. This is a going to be a multi-part series of articles examining what Jersey does with various request/response scenarios, most importantly it will include diagrams! This part will start with a very simple GET request.
10-May-2017
Postman reporting Unexpected 'N' error in response body
I've been using Postman to test some RESTful services and came across a strange error in the body of the response from a service - "Unexpected 'N'". I knew for a fact that the service was not returning this error so something else must have been going haywire.
05-May-2017
Posting array data from a web form to a Jersey REST service
I've written a number of articles about using Jersey over the past few months covering various aspects of RESTful services. This article is about passing in an array of values to your Resource from a form.
22-Apr-2017
Using Jackson to automatically convert Java POJOs to JSON as output of a Jersey service
REST services are great, JSON is great, not having to do any manual conversion between POJOs and JSON is even better. Here's how you do that with Jersey.
22-Mar-2017
Using Jersey 2.x as a shared library on WebLogic 12.1.2
WebLogic 12.1.2 may not be listed on Oracle Technology Network Downloads page but it is still being used. When it comes to RESTful services on WebLogic, 12.1.2 supports Jersey 1.13 so if you're looking to make use of Jersey 2.x features, there's some extra work to be done. With 12.1.3 you can go straight for Jersey 2.x but that's outside the scope of this article.
14-Mar-2017
Injecting a ContainerRequestContext into a Jersey entity provider class
I was implementing a custom entity provider in a Jersey REST service when I came across an error during deployment: "java.lang.IllegalStateException: Not inside a request scope." That struck me as a little odd since I was trying to inject a ContainerRequestContext into a MessageBodyWriter, which should have been within request scope. After some research and this Jersey issue I found a solution.
08-Jun-2015
A quick start with the PayPal PHP SDK for the REST API
PayPal's REST APIs are a very easy way to add e-Commerce functionality to your web project. There is a PHP SDK available for it, and there is a very good API Samples site that covers just about anything you would want to do with the SDK. However something that I thought was missing from this documentation was how to create your PayPal App and Sandbox accounts as well as the autoload.php file that's references but never actually included in the package.
Hi! You can search my blog here ⤵
NOTE: (2022) This Blog is no longer maintained and I will not be answering any emails or comments.

I am now focusing on Atari Gamer.