473,396 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

XML Soap Client Question

Hello all,
I'm a complete newbie looking for a little advice. I am writing a Soap
Client to request weather data from the NOAA website.
(http://www.nws.noaa.gov/forecasts/xml/) and the response to the sent
request is returned in the form of a string. I know I have to use
something like XmlDocument/XmlNode to extract the text from the Xml
tags, but I'm having problems in doing in. Here's what I'm doing:
__________________________________________________ _____________________

private ndfdXML weatherXML = null;
private XmlDocument doc;
private XmlNode rootNode;
private XmlNodeList wList;
private DateTime startDataTime;
......

weatherXML = new ndfdXML(); //create proxy
startDateTime = new DateTime(2005, 2, 4, 9, 15, 0);

String wStr;
XmlNode nextNode;

wStr = weatherXML.NDFDgenByDay(39, -77, startDateTime, "1",

gov.weather.formatType.Item24hourly);

//Append the XML document to the main window
doc = new XmlDocument();
doc.LoadXml(wStr);

rootNode = doc.DocumentElement.FirstChild;

int j;

if (rootNode.HasChildNodes)
{

for (j=0; j<rootNode.ChildNodes.Count; j++)
{
nextNode = rootNode.NextSibling;
WeatherBox.AppendText(nextNode.InnerText + "\n");
}
}
Nov 16 '05 #1
2 4132
A,

You should save the document to disk first (XmlDocument.Save) and open with
a text editor, so that you learn the structure of the document.

Then you can use XPath to select those parts that interest you.

The XML document's root element is DocumentElement itself and not it's
FirstChild.
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"A Golez" <al**********@gmail.com> wrote in message
news:39*************************@posting.google.co m...
Hello all,
I'm a complete newbie looking for a little advice. I am writing a Soap
Client to request weather data from the NOAA website.
(http://www.nws.noaa.gov/forecasts/xml/) and the response to the sent
request is returned in the form of a string. I know I have to use
something like XmlDocument/XmlNode to extract the text from the Xml
tags, but I'm having problems in doing in. Here's what I'm doing:
__________________________________________________ _____________________

private ndfdXML weatherXML = null;
private XmlDocument doc;
private XmlNode rootNode;
private XmlNodeList wList;
private DateTime startDataTime;
.....

weatherXML = new ndfdXML(); //create proxy
startDateTime = new DateTime(2005, 2, 4, 9, 15, 0);

String wStr;
XmlNode nextNode;

wStr = weatherXML.NDFDgenByDay(39, -77, startDateTime, "1",

gov.weather.formatType.Item24hourly);

//Append the XML document to the main window
doc = new XmlDocument();
doc.LoadXml(wStr);

rootNode = doc.DocumentElement.FirstChild;

int j;

if (rootNode.HasChildNodes)
{

for (j=0; j<rootNode.ChildNodes.Count; j++)
{
nextNode = rootNode.NextSibling;
WeatherBox.AppendText(nextNode.InnerText + "\n");
}
}

Nov 16 '05 #2
Golez,
I have done that exact thing in the past. It's a little application in your
taskbar that displays the current temp.
Zip file with the codes is at http://dowhileloop.com/downloads/weather.zip
Code is documented pretty well and you shouldn't have trouble following it.
Hope you find it helpful.
--
in**@dowhileloop.com
http://dowhileloop.com
http://publicjoe.dowhileloop.com -- .NET Tutorials
"A Golez" <al**********@gmail.com> wrote in message
news:39*************************@posting.google.co m...
Hello all,
I'm a complete newbie looking for a little advice. I am writing a Soap
Client to request weather data from the NOAA website.
(http://www.nws.noaa.gov/forecasts/xml/) and the response to the sent
request is returned in the form of a string. I know I have to use
something like XmlDocument/XmlNode to extract the text from the Xml
tags, but I'm having problems in doing in. Here's what I'm doing:
__________________________________________________ _____________________

private ndfdXML weatherXML = null;
private XmlDocument doc;
private XmlNode rootNode;
private XmlNodeList wList;
private DateTime startDataTime;
.....

weatherXML = new ndfdXML(); //create proxy
startDateTime = new DateTime(2005, 2, 4, 9, 15, 0);

String wStr;
XmlNode nextNode;

wStr = weatherXML.NDFDgenByDay(39, -77, startDateTime, "1",

gov.weather.formatType.Item24hourly);

//Append the XML document to the main window
doc = new XmlDocument();
doc.LoadXml(wStr);

rootNode = doc.DocumentElement.FirstChild;

int j;

if (rootNode.HasChildNodes)
{

for (j=0; j<rootNode.ChildNodes.Count; j++)
{
nextNode = rootNode.NextSibling;
WeatherBox.AppendText(nextNode.InnerText + "\n");
}
}

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: RedHat_79 | last post by:
Hello everybody, I have already found a fair bit of information regarding on this group however I wouldn't mind expanding that a bit if possible. :) I am at the moment weighing my options in...
2
by: Paul Hale | last post by:
I have a vb.net web service and client that are both working fine. If someone wanted to consume our web service using .NET, no problem. Im a little confused on how non .NET clients would use the...
4
by: Christian Wilhelm | last post by:
Hi! I have a Problem understanding the deserialisation of SOAP-Responses. The "normal" way, calling a XML WebService is to use WSDL 1) Send Request 2) Get SOAP-Response 3) With Informations...
6
by: A.M-SG | last post by:
Hi, We are developing a SmartClient application and we are planning to expose business objects layer to SmartClient application by using ASP.NET SOAP web services.
31
by: Bryan Dickerson | last post by:
Ok, simple question: from a VB.Net web service (as I've said before, I'm a newbie to SOAP), how would I get the SOAP body into a string? My boss and I concur that it, at least from our...
0
by: info | last post by:
Dear all, is the first time that I use SOAP, and i must say that i'm having several problems. this is SOAP message that expects the server =================XML EXPECTED FROM THE...
6
by: Peter van der veen | last post by:
Hi I have the following problem. I'm calling a webservice from within a VB.net 2005 Windows program. For this i got a WSDL file and loaded that in VB. Until now i just call the webservice and...
2
by: furrypop | last post by:
Hi, I'm trying to get the Perl SOAP::Lite examples to work on a Windows PC, running Apache 2.2.4. Apache is definitely serving CGI scripts, as I've tested a dummy Hello World thing. I'm also...
3
by: Enda Manni | last post by:
Hi, I have a gSoap Web Service written using C++, it uses SOAP username and password authentication. I also have a C# form client consuming the web service, all this was working fine until...
0
by: vigneshrao | last post by:
Hi, I have been working on a script that loops through multiple records and sends data (one record per call) to a WS. I am supposed to make a new call for each record before sending the data....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.