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 4607764
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:44:55+00:00 2026-05-22T00:44:55+00:00

I have a SOAP response that I’m processing in Java. It has a element

  • 0

I have a SOAP response that I’m processing in Java. It has a element with several different child elements. I’m using the following code to try to grab all of the bond nodes and find which one has a child tag with a value of ACTIVE. The NodeList returned by the initial evaluate statement contains 4 nodes, which is the correct number of children in the SOAP response, but they are all duplicates of the first element. Here is the code:

NodeList nodes = (NodeList)xpath.evaluate("//:bond", doc, XPathConstants.NODESET);
for(int i = 0; i < nodes.getLength(); i++){
    HashMap<String, String> map = new HashMap<String, String>();
    Element bond = (Element)nodes.item(i);

    // Get only active bonds
    String status = xpath.evaluate("//:status", bond);
    String id = xpath.evaluate("//:instrumentId", bond);

    if(!status.equals("ACTIVE"))
        continue;

    map.put("isin", xpath.evaluate(":isin", bond));
    map.put("cusip", xpath.evaluate(":cusip", bond));   
}

Thanks for your help,
Jared

  • 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-22T00:44:56+00:00Added an answer on May 22, 2026 at 12:44 am

    The answer to your immediate question is that expressions like //:status will ignore the node that you pass in, and start from the root of the document.

    However, there’s probably an easier solution than what you’ve got, by using XPath to apply the test to the node. I think this should work, although it might contain typos (in particular, I can’t remember whether text() can stand on its own or must be used in a predicate expression):

    //:bond/:status[text()='ACTIVE']/..
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SOAP request that is known to work using a tool like,
I have a WebService that returns XML in a SOAP response: <?xml version=1.0 encoding=utf-8
I have the following SOAP message that i want to post it to my
I am using Java and SOAP. I have two webservices. One (A), which generates
We have SOAP web services in production that are relying on SOAP Headers (containing
I have a SOAP client in Ruby that I'm trying to get working with
I have an incoming soap message wich form is TStream (Delphi7), server that send
Is that possible to have a single PHP SOAP server which will handle requests
I have a client that wants to send a large number of SOAP Header
I have a small SOAP CGI gatewqay C++ program that reads an HTTP SOAP

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.