Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 20607

Re: Connect version 3 of the Orion/SWIS DB from a Java application

$
0
0

Hi, thanks for your reply!

Here is my code:

String query = "select InterfaceID from orion.NPM.Interfaces WHERE NodeID = 59 ";
  
PropertyBag parameters = new PropertyBag();
QueryXmlResponseQueryXmlResult result = swis.queryXml(query, parameters.getAsSoapPropertyBag());
 
MessageElement[] resultXmlArray = result.get_any();
Element resultXml = resultXmlArray[0];
 
XPathFactory factory = XPathFactory.newInstance();
XPath xpath = factory.newXPath();
 
MapNamespaceContext nsContext = new MapNamespaceContext();
nsContext.addNamespace("is", "http://schemas.solarwinds.com/2007/08/informationservice");
xpath.setNamespaceContext(nsContext);

NodeList nodeList = (NodeList) xpath.evaluate("//is:Interfaces", resultXml, XPathConstants.NODESET);

With v2 I get 43 interfaces in nodeList. With v3 nodeList is empty.


Viewing all articles
Browse latest Browse all 20607

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>