If the url you are posting to is not in the same domain then it's a cross site scripting error to post. The easy solution, as you have found, is to get.
The value is nothing because you don't pass anything to your success method:
onSuccess(data,status){
}
$.ajax({
success:onSuccess,
});
Because your function takes a set of arguments, you need to pass something to it. There is a return implied in ajax, so this should work:
$.ajax({
success:onSuccess(data),
});
You should get a result from that. For testing it may be easier just to do this:
function loadData() {
var soapMessage = '<?xml version="1.0" encoding="UTF-8" standalone="no"?><SOAP-ENV:Envelope xmlnsOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://wsendpoints.bbrailapps.firstgroup.com" xmlns:intf="http://wsendpoints.bbrailapps.firstgroup.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ><SOAP-ENV:Body><intf:getVersion xmlns:intf="http://wsendpoints.bbrailapps.firstgroup.com"></intf:getVersion></SOAP-ENV:Body></SOAP-ENV:Envelope>';
$.ajax({
url: "http://railapps.firstgroup.com/FirstGroupRailApps/services/RailAppsCAWS?wsdl",
type: "POST",
dataType: "xml",
data: soapMessage,
processData: false,
contentType: "text/xml; charset=\"utf-8\"",
success: function(data){
alert('success!');
console.log(data);
},
error: onError
});
}