Cloverleaf Call API with Json

QuestionsCategory: QuestionsCloverleaf Call API with Json
Minli Yang asked 3 years ago

Has anyone done any work using Cloverleaf call REST API , get and post data in Json? Really appreciate for your help. We are running Cloverleaf 6.1 .8 on a Linux.

1 Answers
Paul Glezen answered 3 years ago

I’m doing it on 6.1. It’s kind of painful, though. I’m receiving a payload in FRL format that is painstakingly extracted in the following manner:

  append result "{"

append result " \"TrxId\": \"[getTrxId $mh]\","

append result " \"UpdateCode\": \"[msgget $mh 210 1]\","

append result " \"BookingNumber\": \"[msgget $mh 211 9]\","

. . .

for hundreds of lines and then slapped into a new message and sent. We use HTTP for the transport and JSON-RPC for the message format.

We’re in the middle of an upgrade to 6.2.3. There, with JSON support, we can defined a JSON type and avoid all the hard-coded offsets in Tcl code. It’s just field-to-field in the translate rule.

I’ve opened Enhanement Request 34659 to provide support for directly importing JSON schema files.

Minli Yang replied 3 years ago

Thank you so much Paul. Really appreciated your time. Do you need Web service Adapter for JSON to work in Version 6.2 ?

Paul Glezen replied 3 years ago

I did not use Web Service Adapter. I just used the `http-client` protocol and customized the **Query TPS** hook. But that’s mostly because I originally developed it under 6.1 and I’m not yet familiar with the web service adapter improvements that come with 6.2.

Bob Schmid replied 3 years ago

Paul – interesting post! …would you be open to a call on the how to part of adapting

Bob_Schmid@mercy.com

Bob Schmid replied 3 years ago

Paul – interesting post! …would you be open to a call on the how to part of adapting

Bob_Schmid@mercy.com

Related Articles

Attention!

If you already had an existing account on the older server, your username has been imported. However, you can login with your email address. Your old password should still work. But if it doesn't (or you can remember it), then be sure to click on "Forgot Your Password" and follow the instructions!

If you need additional help, please email clovertech@infor.com for additional help and support.

We appreciate your patience!