I have the following Ajax call:
function ajaxCall(soap, url){
$.ajax({
type: "POST",
url: url,
contentType: "text/xml",
data: soap,
dataType: "xml",
processData: false,
beforeSend: passToProxy(url),
success: onSuccess,
error: function(){
getRandom();
}
});
}
function passToProxy(xhr,url1) {
alert(url1);
xhr.setRequestHeader("SOAPTarget","http://localhost:8088/mockSDClientSOAPBinding");
xhr.setRequestHeader("SOAPAction","invoke");
}
I want to pass the url variable to the passToProxy function (I want to replace "http: // localhost: 8088 / mockSDClientSOAPBinding" with the url variable), but I don’t think I have the right idea here, A warning in passToProxy pops up "undefined". What am I doing wrong?
source
share