View Full Version : Tracing WebServiceCalls
GDP_Sabrina
11-12-2003, 07:40 PM
Hi,
finally I discovered some WebService trace opportunity:
myWebService = new WebService("http://www.domain.com/webservice?wsdl");
myPendingCallObj = myWebService.methodName(params);
rawXML = myPendingCallObj.request;
trace("SOAP-Request: "+rawXML);
myPendingCallObj.onResult = function(result){
// catch the result and handle it for this applicationResult
trace("SOAP-Return: "+ result);
};
Ciao for now
Sabrina
Please use the proper code syntax to format the code.
Read this page (http://www.actionscript.org/forums/misc.php3?action=bbcode#buttons) to find out more about the tag information
Jesse
11-13-2003, 06:18 AM
You can also use on(status) and on(data)
you_rock
11-13-2003, 03:11 PM
I can't get this to work.
import mx.services.*;
myWebService = new WebService("http://www.flash-db.com/services/ws/companyInfo.wsdl");
myPendingCallObj = myWebService.doCompanyInfo("any","any","macr");
rawXML = myPendingCallObj.request;
trace("SOAP-Request: "+rawXML);
myPendingCallObj.onResult = function(result){
// catch the result and handle it for this applicationResult
trace("SOAP-Return: "+ result);
};
PS: I am having a similar problem with the results of webservice, when the results are an array instead of a string. Can you help with that too?
http://www.actionscript.org/forums/showthread.php3?s=&threadid=37673
GDP_Sabrina
11-13-2003, 09:51 PM
Hi,
you access the result values easily by using:
var fieldname0 = webService.results.arrayName[0].fieldname;
var fieldname1 = webService.results.arrayName[1].fieldname;
So, you march through the single array lines by counting up the lines while accessing the fields using the "." methodolgy.
Ciao for now
Sabrina
GDP_Sabrina
11-13-2003, 10:00 PM
Don't forget to drag'n drop the WebServiceClass onto the stage.
Your coding looks fine, but maybe there is no WebServiceConnector around that would include that WebService- and SOAPClasses.
Window->Other Panels->Common Libraries->Classes
WebServiceClasses must be put on stage to enable your application to call WebServices.
Ciao for now
Sabrina
you_rock
11-15-2003, 11:32 AM
Thanks
I'll give this a shot
GDP_Sabrina
11-17-2003, 04:05 AM
import mx.services.*;
// load WSDL into memory
myWebService = new
WebService("http://www.flash-db.com/services/ws/companyInfo.wsdl");
//put "onLoad" method directly after WSDL retrieving
// parse WSDL
myWebService.onLoad = function(wsdlDocument) {
/* trace("WS-Call: "+ this.getCall("doCompanyInfo"));
trace("_________________________________");
trace("WSDL-Document: "+ wsdlDocument);
trace("_________________________________");*/
trace(wsdlDocument);
}
var myPendingCallObj:PendingCall =
myWebService.doCompanyInfo("any","any","macr");
myPendingCallObj.onResult = function(result){
// be patient; SOAP request and response are available with
// the onResult-method
/* trace("SOAP-Return: "+ result.symbol);
trace("_________________________________");
trace("SOAP-Request: "+ this.request);
trace("_________________________________");
trace("SOAP-Reponse: "+ this.response);
trace("_________________________________");
trace("SOAP-Values: "+ this.myCall);*/
trace(result);
};
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.