Use ActionScript2 to control the WebService object in Flashmx2004 Professional
Import mx.services. *;
Var log = new log (); log.onlog = function (txt) {trace (txt);} var wsdluri = "http: // localhost: 8080 / axis / service / smsservice? WSDL"; ws = new WebService (WSDLURI LOG);
// WebService onLoad means wsdl has been parsed, the parameter is the wsdl documentws.onLoad = function (wsdl) {// once wsdl is ok, we can make call on the servicetrace ( "WebService.onLoad"); var message = new Pack.Message (); Message.SetContent ("Just A Test"); Message.SetFrom ("beijing"); Message.SetPriority (12345); Message.Setto ("Shanghai"); var mypendingcallobject = ws.send (Message) ); MypendingCallObject.onResult = oncallresult; mypendingcallobject.onfault = oncallfault;}
// Webservice Onfault Means Fail to Parse The Wsdl.ws.onfault = Function (Fault) {Trace ("WebService.onfault ->" Fault.FaultCode);}