Hi,
In the file: packages/web_services/api/soap_api/web_services_caller.js the send() function invokes the callback function using:
eval(callback_fnc+'(response)');
Is there any reason this line is not just:
callback_fnc(response);
And the function passed as the callback_func variable, instead of a string?
I realise this will break existing code, but you could check the type of the variable for backward compatibility.
The reason for this is that is is not possible to pass other useful variables to the callback. To be consistent with jQuery style callbacks it would be good to be able to do something like:
var location = 'http://www.mydomain.com/_web_services/soap-server'; wsdl = 'http://www.mydomain.com/_web_services/soap-server?WSDL';var soapBody = CloneAsset(123, 345, 1, 2, 1); var soapRequest = constructSOAPRequest(soapBody, location); send(wsdl, soapRequest, cloneAssetCallback); var cloneAssetCallback = function(extra_variable) { return function(response) { alert(extra_variable +' '+response); } }
Regards,
Martin