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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:34:44+00:00 2026-05-25T15:34:44+00:00

I’m working on a project and I need to use some webservices, such as

  • 0

I’m working on a project and I need to use some webservices, such as Global Weather, to add to the service..

I’m using NetBeans, and Currently I can use this Web Service to call Weather + Cities By Country Name:
http://www.webservicex.net/globalweather.asmx?WSDL

Anyway, so this is what I’m doing now:

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Weather Finder</title>
    </head>
    <body>
        <h1>Weather Test</h1>    <%-- start web service invocation --%><hr/>
    <%
    try {
    net.webservicex.GlobalWeather service = new net.webservicex.GlobalWeather();
    net.webservicex.GlobalWeatherSoap port = service.getGlobalWeatherSoap();
    java.lang.String countryName = "Australia";
    java.lang.String result = port.getCitiesByCountry(countryName);
    out.println("Result = "+result);
    } catch (Exception ex) {
    }
    %>
    <%-- end web service invocation --%><hr/>

       <%-- start web service invocation --%><hr/>
    <%
    try {
    net.webservicex.GlobalWeather service = new net.webservicex.GlobalWeather();
    net.webservicex.GlobalWeatherSoap port = service.getGlobalWeatherSoap();
    java.lang.String cityName = "Melbourne";
    java.lang.String countryName = "Australia";
    java.lang.String result = port.getWeather(cityName, countryName);
    out.println("Result = "+result);
    } catch (Exception ex) {}
    %>
    <%-- end web service invocation --%><hr/>

    </body>
</html>

Which Returns:

 <!DOCTYPE html>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>Weather Finder</title>
        </head>
        <body>
            <h1>Hello World!</h1>    <hr/>
        Result = <NewDataSet>
      <Table>
        <Country>Australia</Country>
        <City>Archerfield Aerodrome</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Amberley Aerodrome</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Alice Springs Aerodrome</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Brisbane Airport M. O</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Coolangatta Airport Aws</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Cairns Airport</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Charleville Airport</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Gladstone</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Longreach Airport</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Mount Isa Amo</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Mackay Mo</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Oakey Aerodrome</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Proserpine Airport</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Rockhampton Airport</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Broome Airport</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Townsville Amo</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Weipa City</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Gove Airport</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Tennant Creek Airport</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Yulara Aws</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Albury Airport</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Devonport East</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Goldstream Aws</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>East Sale Aerodrome</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Hobart Airport</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Launceston Airport</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Laverton Aerodrome</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Moorabbin Airport Aws</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Mount Gambier Aerodrome</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Mildura Airport</City>
      </Table>
      <Table>
        <Country>Australia</Country>
        <City>Melbourne Airport</City>
      </Table>
      <Table>
        <Country>Australia</Country>
    <City>Macquarie Island</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Wynyard West</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Adelaide Airport</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Albany Airport</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Broken Hill Patton Street</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Ceduna Airport</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Derby</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Darwin Airport</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Bullsbrook Pearce Amo</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Edinburgh M. O.</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Forrest Airport</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Geraldton Airport</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Kalgoorlie Boulder Amo</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Kununurra Kununurra Aws</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Leigh Creek Airport</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Learmonth Airport</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Meekatharra Airport</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Port Hedland Pardoo</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Parafield Airport</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Belmont Perth Airport</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Katherine Aerodrome</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Woomera Aerodrome</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Bankstown Airport Aws</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Canberra</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Coffs Harbour Mo</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Cooma</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Camden Airport</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Dubbo</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Norfolk Island Airport</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Nowra Ran Air Station</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Richmond Aus-Afb</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Sydney Airport</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Tamworth Airport</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Wagga Airport</City>
  </Table>
  <Table>
    <Country>Australia</Country>
    <City>Williamtown Aerodrome</City>
  </Table>
</NewDataSet>


    <hr/>

       <hr/>
    Result = <?xml version="1.0" encoding="utf-16"?>
<CurrentWeather>
  <Location>Melbourne Airport, Australia (YMML) 37-40S 144-50E 141M</Location>
  <Time>Sep 19, 2011 - 07:39 AM EDT / 2011.09.19 1139 UTC</Time>
  <Wind> from the WSW (240 degrees) at 29 MPH (25 KT):0</Wind>
  <Visibility> greater than 7 mile(s):0</Visibility>
  <SkyConditions> mostly cloudy</SkyConditions>
  <Temperature> 57 F (14 C)</Temperature>
  <DewPoint> 44 F (7 C)</DewPoint>
  <RelativeHumidity> 62%</RelativeHumidity>
  <Pressure> 29.53 in. Hg (1000 hPa)</Pressure>
  <Status>Success</Status>
</CurrentWeather>


    <hr/>

    </body>
</html>

Which is Great, But how do I get all that XML Information back into my Java Application so I can put it somewhere useful?

For example, how to I change the Result of the Weather into something more useful like an Array? Or ArrayList and call it somewhere else in my Application.

Thank you!

  • 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-25T15:34:45+00:00Added an answer on May 25, 2026 at 3:34 pm

    You can easily transform (parse) the result XML into a meaningful java object corresponding to the schema of the web service’s result (see http://java.sun.com/developer/technicalArticles/xml/mapping/), and pass it along to a service in your application. Then operate as you want on you (list of) java objects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
I have thousands of HTML files to process using Groovy/Java and I need to
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.