I have been experimenting and trying to learn JQuery, using AJAX to consume a SOAP web service I had written some time ago. Below is the code I am using:
var webServiceURL = 'http://local_server_name/baanws/dataservice.asmx?op=GetAllCategoryFamilies';
var soapMessage = '<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"><soap12:Body><GetAllCategoryFamilies xmlns="http://tempuri.org/" /></soap12:Body></soap12:Envelope';
contentType: "text/xml; charset=\"utf-8\"",
function OnSuccess(data, status)
function OnError(request, status, error)
jQuery.support.cors = true;
<form method="post" action="">
<input type="button" value="Call Web Service" onclick="CallService(); return false;" />
Currently, the method being called in the web service returns an array of category families that contain a category code and a category description. Since the method returns XML, I set the ajax query accordingly. However, when I run the app, I get an 'error' alert box - I am sure what would be causing the problem. I know the web service works, it's called several hundred times a day by other .NET web apps that I've written.
Any help would be greatly appreciated.