Skip to main content
12-Amethyst
May 25, 2023
Solved

How to parse JSON from Windchill Java API program?

  • May 25, 2023
  • 1 reply
  • 2438 views

Hi,

I am working on some Windchill customization for a client. I did a Java program, called as onpublish.afterloadermethod. I call some external REST web services and get back JSON response, which I have to parse.

As Java 8 doesn't have native JSON parser and I don't want to use third party Java JSON library (possible maintenance problems and additional work involved), I want to use some internal solution (like internal JSON library, used by developers), which must exist inside Windchill and will be available with future WIndchill verisons.

Can anybody help me?

Thanks.

Best answer by HelesicPetr

Hi @TomazJeras 

 

Windchill library contains a json.jar library file in <WTHOME>\codebase\lib\json.jar

the jar contains all what you needs to manipulate with a json format.

 

package org.json

HelesicPetr_0-1685080908383.png

 

hope this can help;

 

PS> sure there are others packages

<WTHOME>\srclib\json-smart.jar

<WTHOME>\srclib\json-simple.jar

 

PetrH

1 reply

HelesicPetr
22-Sapphire II
22-Sapphire II
May 26, 2023

Hi @TomazJeras 

 

Windchill library contains a json.jar library file in <WTHOME>\codebase\lib\json.jar

the jar contains all what you needs to manipulate with a json format.

 

package org.json

HelesicPetr_0-1685080908383.png

 

hope this can help;

 

PS> sure there are others packages

<WTHOME>\srclib\json-smart.jar

<WTHOME>\srclib\json-simple.jar

 

PetrH

12-Amethyst
May 26, 2023

Thanks a lot!