Solved

How to send json in application message?

  • 3 June 2020
  • 8 replies
  • 820 views

Userlevel 3
Badge +8

Hi,

I need to send a json string with an application message.

I’m on IFS9 so I can’t use a REST destinationtype, so I’m using Http.

Is there any way I can send a json string instead of an XML ? Its just one line.

Please correct me if I’m wrong, but I don’t think I can create a transformer to do this without access to IFS Developer studio, and I don’t have that. Also I’m unsure if transformers will do json.

Can I create an application message with a json using pl/sql code?

 

 

Best regards

Kresten

icon

Best answer by dsj 4 June 2020, 13:56

View original

8 replies

Userlevel 7
Badge +21

krestensb,

I've checked IFS10 and it contains the following transformer:

Please find attached xmltojson.tar

See if you can create a transformer with it and try to use that. Once saved give it the extension .jar as a jar is not allowed for an attachment.

Steve

Userlevel 3
Badge +8

Thanks for your answer.

I’m affraid this is over my head. I need to design the output in details in order to get the reciever to accept the message, and I can’t make any changes to this .jar.

So I’m affraid I cant use it.

Userlevel 7
Badge +21

But the jar is to transform an xml to json. So any form of xml can be used as input.

However, I can't help you with the inner function of the jar, so I'm also not aware of what it actually is doing.

I checked the options to make changes to the jar and found the following: how-can-i-edit-a-jar-file

Gives me a fair bit of shivers if I read the steps:stuck_out_tongue_winking_eye: .

Userlevel 7
Badge +20

Hi @eqbstal,

It’s a nice hack you have done :sunglasses:

If it does’t work, you can always go for a xsl transformer where you don’t need developer studio.

This transformer in stackoverflow worked for me in App9. 

https://stackoverflow.com/questions/24122921/xsl-to-convert-xml-to-json

 

Duplicate any xsl transformer and create a new one

attached is the xsl copied from above thread, nothing else ;)

 

 

Then in the routing address add the transformer.

Here I used the file out but HTTP should work.

Give a try and let me know the feedback.

Cheers!

Userlevel 7
Badge +21

DSJ,

Thanks for the additional information. I might need that information later on (somewhere in my working life :nerd: )

Userlevel 3
Badge +8

Thanks for taking some of the magic out of this process!

I was not aware that the .xls file is just a XLST script to format XML into somthing else.

w3schools.com has a tutorial, and I’ll go home and read it and see where that brings me. It don’t seem to complicated.

https://www.w3schools.com/xml/xsl_intro.asp

I don’t think there will a need for any java code.

 

Userlevel 7
Badge +20

Thanks for taking some of the magic out of this process!

I was not aware that the .xls file is just a XLST script to format XML into somthing else.

w3schools.com has a tutorial, and I’ll go home and read it and see where that brings me. It don’t seem to complicated.

https://www.w3schools.com/xml/xsl_intro.asp

I don’t think there will a need for any java code.

 

 

Yeah, it’s not hard at all to play with xslt transformer. 

For the record, java transformer ‘really’ don’t need the developer studio also. I’ll try to find an example and post it soon

Userlevel 3
Badge +8

I’ll be looking forward to that!

Reply