6 Replies Latest reply on Dec 5, 2008 10:01 AM by Newsgroup_User

    Parse webservice response in ResultEvent

    JZBAO Level 1
      I'm getting the Soap response from a weather webservice. I can see the XML string in the
      Soap body using Alert.show. But when I tried to retrieve the data inside the XML, I got nothing.

      [Bindable] private var xmlResult:XML;
      private function getResult(event:ResultEvent):void {
      xmlResult = new XML(event.result);
      Alert.show(xmlResult.toXMLString()); //This line shows the soap body. Please see below.
      var xml_list:XMLList = xmlResult.GetCityWeatherByZIPResult;
      Alert.show(xml_list.toXMLString()); //This line shows nothing.

      I also tried {xmlResult..City}, but it returns nothing.

      This is what I see in the first Alert window:
      <GetCityWeatherByZIPResponse xmlns=" http://ws.cdyne.com/WeatherWS/" xmlns:soap=" http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd=" http://www.w3.org/2001/XMLSchema">
      <ResponseText>City Found</ResponseText>
      <Description>Mostly Sunny</Description>