Been trying my best to understand this correctly. What is the difference between an XML, SOAP and JSON response? And how does one know how to call a web service whose response i
I have used this web service before. It expects and returns XML. Here's the code I used to get to work in Internet Explorer (For Firefox you need to use the jsonp).
$('#Currency').bind('change', function() {
var targetDiv = '#Result'
var currencyValue = $('#Currency option:selected').val();
var webMethod = 'http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate';
var parameters = "?FromCurrency=GBP&ToCurrency=" + currencyValue;
$(targetDiv).html('loading...');
$.ajax({
type: "GET",
url: webMethod + parameters ,
contentType: "text/xml; charset=utf-8",
dataType: "xml", //for Firefox change this to "jsonp"
success: function(response) {
$(targetDiv).html(response.text);
},
error: function(xhr, textStatus, errorThrown) {
$(targetDiv).html("Unavailable: " + textStatus);
}
});
)};