I am new to Ajax. I want to retrieve the transaction details from the merchant website after payment processing. My ajax call script is not working. Please help.
C# Method:
public class RetrieveCache{[WebMethod]public string RetrieveTransactionData(string ID){
ChannelFactory<ServiceSoap> PayChannelFactory = new ChannelFactory<ServiceSoap>("ServiceSoap12");
ServiceSoap Paychannel = PayChannelFactory.CreateChannel();
XmlNode node = Paychannel.RetrieveCachedData(ID);return node.InnerXml;
}}
Ajax call Script in HTML Page to call the above c# method
Html Page URL: http://localhost:55014/SuccessPage.html?id=29473740923
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript">
</script><script type="text/javascript"> $(document).ready(function () {
var url = window.location.search; debugger;var token = (url.replace("?", "").split("=")[1]).toString(); debugger;var dataval = JSON.stringify({ token: token }); $.ajax({ url: "http://localhost:55014/RetrieveCache.cs/RetrieveTransactionData", type: 'post', data: JSON.stringify({ token: token }), contentType: 'application/json; charset=utf-8', dataType: 'json', success: function(data){ alert(data);}, error: function (err) { alert(err)}});});
</script>
This is the error message in console: localhost:55014/RetrieveCache.cs/RetrieveTransactionData 404 (Not Found)