Original Message:
Sent: Thu March 20, 2025 01:10 AM
From: Suhas Joshi
Subject: Adding additional attributes in the web service response
Hi Andrezj,
We have some issue currently testing web service so for now we are testing with a http post using below url in postman with the above JSON input to create a workorder. If there is no user exit script, response gives back the key fields (wonum, siteid). However, as soon as I add the script to provide description field in the response, I get the above mentioned error.
URL - hostname:port/meaweb/es/extsysname/entservname
------------------------------
Suhas Joshi
Original Message:
Sent: Wed March 19, 2025 07:38 AM
From: Andrzej Więcław
Subject: Adding additional attributes in the web service response
Hi Suhash,
I would be way easier to help you in your specific case if you share exact details of your config. So far I've been assuming that you're using classic (SOAP) web service with XML payload and apparently I was wrong....
There might be differences in how JSON vs XML is being handled throughout the integration processing pipeline. Therefore in order to avoid any further misunderstanding please describe in an concise way how did you set up your "endpoint" and how do you call it (preferably with curl equivalent included).
------------------------------
Andrzej Więcław
Maximo Technical SME
ZNAPZ B.V.
Wrocław, Poland
Original Message:
Sent: Wed March 19, 2025 06:44 AM
From: Suhas Joshi
Subject: Adding additional attributes in the web service response
Hi Andrezj,
I tried setting up the system property first which gives me the key fields in the response. It is Sync operation. Now I wrote below script to add description to my response. It is enterprise service --> Response -->User Exit-->After External Exit. I am getting an error.
Script:
irData.breakData()
irData.setCurrentData("DESCRIPTION","hello")
Error:
null at psdi.iface.mic.EntMicService.processDataIn(EntMicService.java:1488) at psdi.iface.mic.EntMicService.processExternalData(EntMicService.java:1335) at psdi.iface.mic.EntMicService.processExternalData(EntMicService.java:1163)
Caused by: java.lang.NullPointerException at psdi.iface.mic.StructureData.breakData(StructureData.java:634) at psdi.iface.migexits.ExitProcessor.makeStructureData(ExitProcessor.java:381) at psdi.iface.migexits.ExitProcessor.processTheseExitsOut(ExitProcessor.java:350)
Input JSON to create a WO is:
{
"siteid":"ABCD",
"orgid":"PQRS",
"description":"test workorder. Please ignore"
}
------------------------------
Suhas Joshi
Original Message:
Sent: Tue March 18, 2025 04:07 AM
From: Andrzej Więcław
Subject: Adding additional attributes in the web service response
Hi Suhas,
as you said, by default Maximo eventually in response returns only values of key attributes (ref. Including responses to every WebService call for more details).
It is though possible to include more information in the response by injecting customization into processing pipeline. This can be done in several ways - object structure or enterprise service level - depending on your needs.
One example way of doing this could be by implementing enterprise service outbound exit processing class or automation script.
The class or script itself can append whatever information you like to the response. Following one, defined for MXGLCOMPInterface
,
appends to every object in the response COMPTEXT
value.
for(var i = 0; i < irData.getSize(); i++) {
irData.setCurrentPosition(i);
irData.setAsCurrent();
irData.setCurrentData("COMPTEXT", irData.getCurrentMbo().getString("COMPTEXT"))
}
------------------------------
Andrzej Więcław
Maximo Technical SME
ZNAPZ B.V.
Wrocław, Poland
Original Message:
Sent: Wed March 12, 2025 12:52 AM
From: Suhas Joshi
Subject: Adding additional attributes in the web service response
Hi,
We have a web service based on enterprise service. In the response(Create/Update), we get the values of key attributes (such as wonum, siteid). However, along with these key attributes, we also need to add few more attributes in the response. Is it possible? If someone has done something like this earlier, please share your inputs.
#IBMMaximo
#IBMMaximoAssetManagement
#Maximo
Thanks,
Suhas
------------------------------
Suhas Joshi
------------------------------