Send request to web service via NXSL script

Started by saksham.adyso, September 25, 2024, 09:54:49 AM

Previous topic - Next topic

saksham.adyso

Does the NXSL script support a function to make a request to a web service and return the retrieved data and HTTP code?

uldis

Hi, here would be example from documentation and the script needs to be executed on the node where agent with "EnableWebServiceProxy=yes" is running.


webSvc = $node.getWebService("web_service_definition_name");
result = webSvc.get();
println(result.httpResponseCode);
println(result.document);


If this agent is on your NetXMS server node, you can use GetServerNode() instead of $node, this way you can run this script in context on any node.