NetXMS Support Forum

English Support => General Support => Topic started by: saksham.adyso on September 25, 2024, 09:54:49 AM

Title: Send request to web service via NXSL script
Post by: saksham.adyso on September 25, 2024, 09:54:49 AM
Does the NXSL script support a function to make a request to a web service and return the retrieved data and HTTP code?
Title: Re: Send request to web service via NXSL script
Post by: uldis on September 26, 2024, 12:32:56 PM
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.