Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Error handling in generated stubs

Avatar

Avatar
Level 1
wabisabi2004
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
wabisabi2004
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
wabisabi2004
Level 1

09-12-2008

Hello,



I've been playing around with Flex Builder 3 and WS and I am
puzzled by how one can handle generic SOAP error messages (i.e. not
the service faults, but connection errors, message parsing related
errors, etc.).



Here is what I try:



1 Generate service stubs out of an existing WSDL using Flex
Builder

2 Create a dead simple Flex app that makes a WS call via
stubs

3 Trying to call an unreliable WS, and I get Flash popup
with the stack trace:


quote:





TypeError: Error #1090: XML parser failure: element is
malformed.

at
mx.rpc.soap::SOAPDecoder/decodeResponse()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\soap\SOAPDecoder.as:234]

at com.ws::BaseLookupService/processResult()[C:\Documents
and Settings\ws\My Documents\Flex Builder
3\FlexClient\services\lookup\com\ws\BaseLookupService.as:237]

at
mx.rpc::AsyncResponder/result()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\AsyncResponder.as:84]

at
mx.rpc::AsyncRequest/acknowledge()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:74]

at
DirectHTTPMessageResponder/completeHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:381]

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at flash.net::URLLoader/onComplete()







It looks like neither registering fault handler nor adding
event listener to the AsyncToken catches this error.



Does anyone know if I should I be modifying the generated
stubs to catch this kind of errors or there is a more elegant
approach to fix this? Thanks.