//callback是PendingCall的实例. callback.encode(); callback.callbackMethod = callbackMethod; // Callback method // Populate parameters callback.setupParams(args); // prepare response object var response = new XML(); response.ignoreWhite = true; response.callback = callback; response._startTimeMark = startTime; callback.response = response; // create the async response mechanism response.onData = function(src) { } // fire message callback.request.sendAndLoad(this.endpointURI, response, "POST"); //------------------------------------------------------------------------------------------- |
POST /WebService/test.asmx HTTP/1.1 Host: roading.net Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://www.roading.net/say" <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <say xmlns="http://www.roading.net/"> <str>string</str> </say> </soap:Body> </soap:Envelope> |
POST /WebService/test.asmx HTTP/1.1 Host: roading.net Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: http://www.roading.net/say |
// r.requestHeaders.push(new URLRequestHeader("Content-Type", "text/xml;charset=utf-8")); r.requestHeaders.push(new URLRequestHeader("SOAPAction", "http://www.roading.net/say")); // |
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <say xmlns="http://www.roading.net/"> //调用方法.. 命名空间 <str>hello</str> //参数 </say> </soap:Envelope> |
//WebService网址(为测试写的例子) http://www.roading.net/WebService/test.asmx import flash.net.*; var soap:Namespace = new Namespace("http://schemas.xmlsoap.org/soap/envelope/"); var r:URLRequest = new URLRequest("http://www.roading.net/WebService/Test.asmx?op=say"); r.method = URLRequestMethod.POST; r.requestHeaders.push(new URLRequestHeader("Content-Type", "text/xml;charset=utf-8")); r.requestHeaders.push(new URLRequestHeader("SOAPAction", "http://www.roading.net/say")); var rXML:XML = <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body/> </soap:Envelope> ; rXML.soap::Body.appendChild( <say xmlns="http://www.roading.net/"> // <str>hello</str> // </say> ); r.data = rXML; var l:URLLoader = new URLLoader(); l.dataFormat = URLLoaderDataFormat.TEXT; l.load(r); l.addEventListener("ioError" ,err); l.addEventListener(Event.COMPLETE,xmlLoaded); function xmlLoaded(d) { trace(l.data); t.text = l.data; } function err(e) { trace(e); } |
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |