Control WebService objects using ActionScript2

zhaozj2021-02-16  68

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);}

转载请注明原文地址:https://www.9cbs.com/read-16843.html

New Post(0)