Stuck on SOAP WebService

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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:...
    4. WebService support for SOAP 1.2
      Does the .NET Framework v1.1, System.Web.WebService support SOAP 1.2?
    5. 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...
  3. #2

    Default 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

  4. #3

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139