Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
wildkatana #1
Stuck on SOAP WebService
Okay, I have been banging my head against this code all day and still can't
quite get it, although I have made some progress. I am trying to access A
WebService through SOAP. I can get the request sent and everything and it
returns the xml document as a result. But the problem is, I don't know how to
access individual parts of that result. I think that the result is being sent
as a string instead of XML, but I'm not sure how to fix that... I am very new
to all of this (Just started using Flex and APIs and Mashups and SOAP and XML
today lol) but I am excited to learn and would appreciate some pointers. Here
is my code: (I am trying to make a mashup)
(...)
<mx:WebService
id="WeatherService"
wsdl="http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl"
useProxy="false">
<!-- Bind the value of the ZIP code entered in the TextInput control
to the ZipCode parameter of the GetWeather operation. -->
<mx:operation name="NDFDgen"
fault="mx.controls.Alert.show(event.fault.faultStr ing)"
result="showResults()">
<mx:request>
<latitude>38.9900</latitude>
<longitude>-77.0100</longitude>
<product>time-series</product>
<startTime>2004-01-01T00:00:00</startTime>
<endTime>2012-02-12T00:00:00</endTime>
<weatherParameters>
<maxt>1</maxt>
<mint>0</mint>
<temp>0</temp>
(...)
<wgust>0</wgust>
</weatherParameters>
</mx:request>
</mx:operation>
</mx:WebService>
(...)
public function showResults():void {
Alert.show(WeatherService.NDFDgen.lastResult);
}
The problem is that when I try to access data inside the xml I get errors.
This is what I try to do:
Alert.show(WeatherService.NDFDgen.lastResult.head. source.credit);
This is a sample of the xml file:
<?xml version="1.0"?>
<dwml version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.nws.noaa.gov/forecasts/xml/DWMLgen/sch
ema/DWML.xsd">
<head>
<product srsName="WGS 1984" concise-name="time-series"
operational-mode="official">
<title>NOAA's National Weather Service Forecast Data</title>
<field>meteorological</field>
<category>forecast</category>
<creation-date
refresh-frequency="PT1H">2008-05-20T07:04:30Z</creation-date>
</product>
<source>
<more-information>http://www.nws.noaa.gov/forecasts/xml/</more-information>
<production-center>Meteorological Development
Laboratory<sub-center>Product Generation Branch</sub-center></production-center>
<disclaimer>http://www.nws.noaa.gov/disclaimer.html</disclaimer>
<credit>http://www.weather.gov/</credit>
<credit-logo>http://www.weather.gov/images/xml_logo.gif</credit-logo>
<feedback>http://www.weather.gov/feedback.php</feedback>
</source>
</head>
<data>
<location>
(...)
Any ideas what I am doing wrong? Thanks in advance also any pointers to help
my coding would be appreciated, I am very new.
wildkatana Guest
-
MSDE got stuck in WebService
I have a WebService which simply obtain data remotely from a PocketPC PDA and store it in the database. The following codes are one of the functions... -
Consuming webservice using soap in VB.Net
Hi All, I have a web service and i wanted to access that webservice from a vb.net application. I have no problems accessing the web service either... -
Soap formatting webservice
Hello, i have a certain XML formatting and i want my webservice to act upon it Does anyone have an idea how to do it: HTTP/1.1 200 OK Date:... -
WebService support for SOAP 1.2
Does the .NET Framework v1.1, System.Web.WebService support SOAP 1.2? -
Webservice, add SOAP-Header
Oliver, I haven't tried it, but I imagine you can probably do this with a SoapExtension on the client side. That said, is there any reason why... -
Developer504 #2
Re: Stuck on SOAP WebService
I'm new to Flex myself so take this with a grain of salt, but I think if your
data source is XML you have to convert it using E4X to do more than a simple
display. What specific errors are you getting?
I have one program which reads XML from an HTTPService Post and snaps that to
a datagrid, maybe you could try that.
Developer504 Guest
-
wildkatana #3
Re: Stuck on SOAP WebService
Hmmm. I think what I need to do is figure out a way to convert a string
variable (the xml) to an xml variable. Any ideas on that? I have the xml data
stored in a string variable right now, but I want to traverse it's contents
using the '.' Any ideas?
wildkatana Guest



Reply With Quote

