Question
· May 22, 2022

Using a Service to get data (Inbound or outbound adapters)

Hi Guys.

 

I'm a newbie in productions and services and I'm using this code to get HTTP response with JSON file, is a way to do this via a production service?

 

set Httprequest ##class(%Net.HttpRequest).%New()
  Set Httprequest.SSLConfiguration="RTLS"                              
  Set Httprequest.Server="serverurl"                 
  Set Httprequest.Https=1
  Set Httprequest.Timeout=30
  Token="sometoken_value"
   set Httprequest.ContentType="application/json"
Do Httprequest.SetHeader("Accept","application/json")
Do Httprequest.SetHeader("Authorization","Bearer "_Token)
   set tSc = Httprequest.Post("/api/jobs")
  //S Resp=Httprequest.HttpResponse.Data.ReadLine()
   Set Resp=Httprequest.HttpResponse.Data.Read()
   Quit Resp

 

Thanks

Product version: Ensemble 2014.1
Discussion (2)1
Log in or sign up to continue

Hi Rochdi- You can refer the following link to understand basic Ensemble production concepts.

Introduction to Ensemble Productions

You can add a Business Operation with EnsLib.HTTP.OutboundAdapter
to add your code to process HTTP request & response. (See About the HTTP Adapters for further info)

Finally - the following article should further help you with your query - Interoperability: Creating Components (Business Operation)