Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. Web Service XML with node attributes generates ERROR

Web Service XML with node attributes generates ERROR

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 36.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    M
    mashedpotatorocket
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • F
      F
      Filipp Sudanov
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • F
        F
        Filipp Sudanov
        wrote on last edited by
        #3

        XPath was added in 4.5.0, so you can try using this.

        1 Reply Last reply
        0
        • M
          M
          mashedpotatorocket
          wrote on last edited by
          #4

          We upgraded to 4.5.3 today and had a new look on my Web Services. XPath is working perfectly. Thank you!

          1 Reply Last reply
          0

          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
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          Powered by NodeBB Contributors
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups