Web Service XML with node attributes generates ERROR
-
Hello.
I'm trying to collect data from a web service. The xml data has this format:
<?xml version="1.0" encoding="UTF-8"?>
<Result>
<UserStatus Status="2" StatusFrom="230904080005" ClientType="13,16" Device="tel:0123456789" TerminalCapabilities="1" DeviceStatusFrom="231204092543" OfficeDeviceStatusFrom="230918121327" MobileDeviceStatusFrom="231204092543" ServerTime="231204155632" DisplayName="Full Name">[email protected]</UserStatus>
</Result>When using DCI parameter WebService1:/Result/UserStatus, I get [email protected] returned.
When trying to collect the value of an attribute, for example WebService1:/Result/UserStatus/Status, I get <<ERROR>> instead of the value 2.Is the XML parser in NetXMS compliant with the XML standard?
When testing on xmlvalidation.com it says No errors were found, and this PowerShell oneliner demonstrates it should work:([xml]'<Result><UserStatus Status="2"/></Result>').Result.UserStatus.Status
Thanks in advance.
-
current xml parsing code does not support this. In the future we will consider adding xms parsing library (same as we now have jq to parse json format). You can follow this ticket: https://track.radensolutions.com/issue/NX-2485
Currently you can enable "Process response as plain text" in properties of the web service and use a regex instead of path to get the value
-
XPath was added in 4.5.0, so you can try using this.
-
We upgraded to 4.5.3 today and had a new look on my Web Services. XPath is working perfectly. Thank you!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login