Welcome Guest! Log in


The HTTP Response Code returned at the end of Stambia Web Services invocations can be fully customized.

Prerequisites:
  • This is only available for the HTTP REST API
  • Stambia DI Runtime S17.4.0 or higher

 

Note:

This should be used to use a specific HTTP Response code.

To return a specific HTTP response message, please refer to this article.

 

Configuration of the Process

Creation of the Process Parameters

First, create the Process Parameter that will contain the value of the HTTP Response Code.

Design it as usual, and set a default value to avoid the case where it wouldn't be filled during the Process execution

1.createParameter

 

Configuration of the META-INF

Next, lead to the main Process Properties, and open the Meta-Inf tab.

Add in the box the following sample of code and replace it with your own settings:

<httpRestWebServiceProperties extractRequestInfo="true">
    <responseCodeMapper parameterName="httpResponseCode" />
</httpRestWebServiceProperties>

 

Attribute Description
parameterName The name of the Process Parameter that contains the HTTP Response Code value

 

Usage

At the end of the Web Service invocation, the value contained in the specified Process Parameter will be use to set the HTTP Response Code returned to the user invoking the Web Service.

 

Comments  

# Nicolas Verscheure 2018-02-05 15:45
Is it possible to set the HTTP Response Message ?
# risson 2018-02-06 16:08
I don't think so
# nverscheure 2018-10-29 10:03
In fact, it is possible : http://stambia.org/doc/64-technology-articles/web-services/publishing/466-customizing-the-input-output-http-body-of-a-stambia-web-service

You have no rights to post comments

Articles

Suggest a new Article!