Flex Webservice call any errors that may arise, monitor the error which

2010-07-22  来源:本站原创  分类:Flash  人气:196 

Web service is no way to judge whether the path of error, whether the coding error, whether the decoding error, and so wrong because there is very little information online, I order, view the summary obtained sdk

private var webserviceURL: WebService = new WebService ();
webserviceURL.addEventListener (LoadEvent.LOAD, loadWebHandle);
webserviceURL.addEventListener (FaultEvent.FAULT, webFaultHandle);
webserviceURL.addEventListener (ResultEvent.RESULT, rezultHandle);

private function loadWebHandle (e: LoadEvent): void (

webserviceURL.removeEventListener (FaultEvent.FAULT, webFaultHandle);
webserviceURL.removeEventListener (LoadEvent.LOAD, loadWebHandle);
trace ("finished loading");
)
private function webFaultHandle (e: FaultEvent): void (
webserviceURL.removeEventListener (FaultEvent.FAULT, webFaultHandle);
webserviceURL.removeEventListener (LoadEvent.LOAD, loadWebHandle);
trace ("call error");
)
private function rezultHandle (e: ResultEvent): void (
webserviceURL.removeEventListener (FaultEvent.FAULT, webFaultHandle);
webserviceURL.removeEventListener (LoadEvent.LOAD, loadWebHandle);
trace ("call succeeded");
)

Operation of possible errors
var fault2: Fault = new Fault ("EncodingError", errorMsg);
var fault2: Fault = new Fault ("DecodingError", errorMsg);
var fault: Fault = new Fault ("Client.MustUnderstand", msg);
var errMsg: String = "Cannot invoke method" + name + "as WSDL did not load successfully";
dispatchRpcEvent (createFaultEvent ("Client.InvalidWSDL", errMsg));
F ("Client.NoSuchMethod", "Couldn't find method '" + name + "' in service."

WebServic errors that may arise
/ / MustSpecifyWSDLLocation
var fault: Fault = new Fault ("Client.WSDL", message);
/ / DestinationOrWSDLNotSpecified
var fault: Fault = new Fault ("Client.WSDL", message);
/ / UnexpectedException
var fault: Fault = new Fault ("WSDLError", message);
var fault: Fault = new Fault ("ConcurrencyError", message);

For example:
<Mx: WebService fault = "wsfault (event)"
wsdl = "http://172 .*.*. 11:8080 / cb_test / user? wsdl"
useProxy = "false" showBusyCursor = "true" requestTimeout = "10">
<mx:operation name="login" result="result(event)" fault="fualt(event)" />
</ Mx: WebService>

private function wsfault (event: FaultEvent)
(
var str: String = event.fault.FaultCode;
/ / To determine the type of error according to str, and if WSDLError, that is unexpectedException, and so on
)
private function fault (event: FaultEvent)
(
var str: String = event.fault.FaultCode;
/ / To determine the type of error according to str, and if Client.NoSuchMethod, show that the method is not, and so the above operation, all of which can be judged by this
)

相关文章
  • Flex Webservice call any errors that may arise, monitor the error which 2010-07-22

    Web service is no way to judge whether the path of error, whether the coding error, whether the decoding error, and so wrong because there is very little information online, I order, view the summary obtained sdk private var webserviceURL: WebService

  • Cross-domain calls issue of Flex Webservice 2010-07-22

    Recently in a project to do with Flex, as usual in the native debugging, reached after the server the following error: [RPC Fault faultString = "Security error accessing url" faultCode = "Channel.Security.Error" faultDetail = "Una

  • Dynamic Flex Webservice method call (Advanced Edition) 2010-07-13

    Promotion articles <Mx: WebService wsdl = "http://www.webservicex.net/globalweather.asmx?WSDL" showBusyCursor = "true" useProxy = "false"> <mx:operation name="GetCitiesByCountry" result="result(event)&

  • flex Webservice which events can be monitored 2010-07-22

    private var webserviceURL: WebService = new WebService (); webserviceURL.addEventListener (LoadEvent.LOAD, loadWebHandle); webserviceURL.addEventListener (FaultEvent.FAULT, webFaultHandle); webserviceURL.addEventListener (ResultEvent.RESULT, rezultHa

  • Flex + WebService Development Example 2010-08-27

    Main code Webservices.mxml code: Mxml code 1. <? Xml version = "1.0" encoding = "utf-8"?> 2. <mx:Application Xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> 3. <mx:WebService Wsdl="h

  • Flex WebService calls to access MSSQL database 2010-11-06

    <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" fontSize="12"> <mx:Script> <![CDATA[ import mx.events.ResizeEvent; im

  • Flex WebService access through the client's IP address and weather conditions 2010-12-29

    <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="ini()"> <mx:WebService wsdl="http://www.webxml.com.cn/WebS

  • [To] build Flex applications, 10 major errors 2011-05-31

    Original Address: http://www.infoq.com/cn/news/2008/04/top-10-flex-mistakes English original: Top 10 Mistakes when building Flex Application In this news, Adobe's James Ward and bring you together with InfoQ.com another 10 Flex (Flex recent 10). Flex

  • With flex WebService + photoshop to write a weather component 2011-01-14

    Look at the map it: This is the initial oh: Click more to get tomorrow, the day after tomorrow the weather Look at the overall effect on the web site: If you do not want to show it, then click the Close button This time following the sun icon will tu

  • Flex in the Image display the default image loading image error 2010-07-30

    Web page used to effect ... Picture does not exist .. turn the default picture Two general approaches to web page .. js server redefine or redirect ... In the flex / flash in the corresponding method can also listen ioError event .. .. and then speci

  • Webservice using Httpservice and communicate to and Flex 2010-12-23

    About httpservice configuration, flex webservice through httpservice and data transmission way, now to configure httpservice. The following sentence to the configuration can be httpservice <mx:HTTPService url="jindex.jsp" resultFormat="x

  • Flex Error List 2010-03-29

    The following run-time errors may occur. In ActionScript 3.0, both in the strict mode or warning mode, compile, will be run-time type checking. Code Message Description 1000 system memory. The system memory available to compile the code does not meet

  • Simple letter of introduction Flex and Web services interaction 2010-07-18

    Simple letter of introduction Flex and Web services interaction Contents: 1.ActionScript the basic interaction with the server mode (REST). 2.ActionScript unique data transfer format (AMF) with the server. 3.Flex and WebService. ActionScript and serv

  • Flex on cross-domain policy file crossdomain.xml 2010-08-16

    When Flex access WebService Service, the normal access to the local , When deployed to the web container is released web Service, then call WebServicIE, At this time will be denied access, which is Flex Sandbox cross-domain access issues , In order t

  • Flex to solve the problem of cross-domain policy file written 2010-09-14

    /*************************** Policy file crossdomain.xml ***************** **********/ A basic explanation to another domain with the Flash document to access the data. Flash Player will automatically try to load the policy file from that domain. If

  • flex to solve cross-domain policy file writing problem 2010-11-16

    /*************************** Policy file crossdomain.xml ***************** **********/ First, explain the basis of the document with the Flash data access to another domain. Flash Player will automatically try to load the policy file from that domain

  • Flex sandbox security (to) 2010-12-15

    Download the modified source code made flexpaper swf reader, to join the swf file to be read, you can flex the method to call to get the swf js file path by way of the access path js focus only on the line, waiting for the flex to call: However, one

  • AS3 WebService methods to access the pure confluence 2011-01-13

    Today, introduce the pure AS3 WebService method to access ... Flex if you have the body brought to this class .. The class or have a third party .. That can not continue to look down because I was not introduced .. "WebService class to use" .. N

  • Build your own Flex MVC framework 2010-05-29

    Ago with the Cairngorm framework of time, quite surprised, actually only the size of a dozen K Is it simple? Spent some time, found to be a MVC framework actually not that difficult (difficult in the perfect and universal) Also want to pursue their o

  • Work log for flex articles 2010-08-01

    1 exception: java.lang.noClassdefFoundError: could not initialize class com.sun.xml.bind.v2.model.impl.RuntimeModekBuilder: Solution: Replace 1.6.16 JDK from 1.6 to 2, flex4 failure to set the scroll bar: Solution: Add the layout settings <s:scroller