Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4335500
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:40:41+00:00 2026-05-21T10:40:41+00:00

My service(written in Java) returns me an output in the format: serviceMetricList: [ {MetricDataList:

  • 0

My service(written in Java) returns me an output in the format:

 "serviceMetricList": 
  [
    {"MetricDataList": 
      {"metricDataList": 
        [
          {"metricDate": "2011-04-05T14:50:00.000Z", 
           "metricValue": "427448.0"}, 
          {"metricDate": "2011-04-12T14:30:00.000Z", 
           "metricValue": "430089.0"}
        ]
      }, 
     "urlSerialNo": "1"}
     }
  ]

I need to retrieve the values metricDate and metricValue from my Ruby client. Am not sure about how this can be done. Any help in this regard will be great.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T10:40:42+00:00Added an answer on May 21, 2026 at 10:40 am

    If you want to parse this data format, you first need to know what data format it is. It doesn’t appear to be any well-known data format and it’s not any format I know. It’s obviously not JSON, nor is it YAML and definitely not XML.

    So, you’ll probably have to write your own parser. Or a preprocessor which converts the data into a more well-known format, for wich a parser already exists.

    For example, if you were to convert the example to YAML, it would look something like this:

    "serviceMetricList": 
      [
        {"MetricDataList": 
          {"metricDataList": 
            [
              {"metricDate": "2011-04-05T14:50:00.000Z", 
               "metricValue": "427448.0"}, 
              {"metricDate": "2011-04-12T14:30:00.000Z", 
               "metricValue": "430089.0"}
            ]
          }, 
         "urlSerialNo": "1"
        }
      ]
    

    And you could parse it like this:

    require 'yaml'
    h = YAML.load(your_java_data)
    
    Date.parse(h['serviceMetricList'][0]['MetricDataList']['metricDataList'][0]['metricDate'])
    # => #<Date: 2011-04-05 (4911313/2,0,2299161)>
    
    Float(h['serviceMetricList'][0]['MetricDataList']['metricDataList'][0]['metricValue'])
    # => 427448.0
    
    # or maybe, if you don't like to lose precision:
    require 'bigdecimal'
    
    BigDecimal(h['serviceMetricList'][0]['MetricDataList']['metricDataList'][0]['metricValue'])
    # => #<BigDecimal:eb8240,'0.427448E6',8(12)>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a C# client that calls a web service written in Java
Using google's Protocul Buffers , I have a service already written in Java which
I have a server written in Java that runs as a Windows service (thanks
I've got a Java web service in JAX-WS that returns an OutputStream from another
I am consuming a webservice (written in java) - that basically returns a byte[]
I have a Windows Service (written in Java) that needs to start other Windows
I have written a persistent windows service in java that runs on boot. I
I have one module written on Java - web service module which accepts request
I'm trying to connect to a web service, written in Java, but there's something
We have a Windows Service written in C#. The service spawns a thread that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.