The format of XML file returned from web service

The format of XML file returned from web service

Post by MayLam1 » Fri, 02 May 2008 10:54:42


hanks for everyone's reply!

Sorry, I don't know where to set resultFormat="e4x". Below is my code. And
Line 111 gives error. And the error message is below. And the xml returned
from the web service is below.

Error: Error #2093: The Proxy class does not implement getDescendants. It must
be overridden by a subclass.
at Error$/throwError()
at
flash.utils::Proxy/http://www.adobe.com/2006/actionscript/flash/proxy::getDescen
dants()
at LogIn/loginHandler()[P:\JIMMY-FLEX\Flex_LogIn\LogIn.mxml:58]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at
mx.rpc::AbstractService/dispatchEvent()[E:\dev\3.0.x\frameworks\projects\rpc\src
\mx\rpc\AbstractService.as:232]
at
mx.rpc::AbstractOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRp
cEvent()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AbstractOperation.as:19
3]
at
mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandle
r()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:191]
at
mx.rpc::Responder/result()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\Respo
nder.as:41]
at
mx.rpc::AsyncRequest/acknowledge()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\r
pc\AsyncRequest.as:74]
at
DirectHTTPMessageResponder/completeHandler()[E:\dev\3.0.x\frameworks\projects\rp
c\src\mx\messaging\channels\DirectHTTPChannel.as:381]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()


<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%"
height="100%" xmlns:ns1="*">


<mx:Script>
<![CDATA[

import mx.rpc.events.ResultEvent;
namespace FaciNS = "http://FaciNet.com/";

import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.soap.WebService;

//public var __xmlResult:XML;
public var ws:WebService;


public function Log_In(UN:String, PW:String):void
{
ws.Login(UN, PW);

}

public function getLoginData():void {

loadWSDL();
Log_In(UN.text, PW.text);
}

public function loadWSDL():void
{

ws = new mx.rpc.soap.WebService();
ws.wsdl = "http://localhost:50779/VS2008_LogIn/Service.asmx?wsdl"
ws.useProxy = false;
ws.addEventListener("fault", faultHandler);
ws.addEventListener("result", loginHandler);
ws.loadWSDL();
}


public function loginHandler(e:ResultEvent):void {
var wkSouID:String = e.result[0]..SouID; // LINE 111

trace(wkSouID);
}

public function faultHandler(event:FaultEvent):void
{
dispatchEvent(new Event("Error"));
}

public function checkUser(UName:String, PWord:String):void {

getLoginData();
}

]]>
</mx:Script>

<mx:Panel id="loginPanel" horizontalScrollPolicy="off"
verticalScrollPolicy="off
 
 
 

The format of XML file returned from web service

Post by MayLam1 » Fri, 02 May 2008 11:03:36

I have just solved my problem.

Replace Line 111 by the following line:

var wkSouID:String = e.result[0].valueOf().SouID.toString();

And it works.

Thanks,
May