I am trying to call jax-ws webservice from javascript using jquery. Here is my HTML code
<html>
<head>
<title>Calling Web Service from jQuery</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#btnCallWebService").click(function (event) {
var soapRequest = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"+"<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema/\" xmlns:core=\"http://core.codon.com/\"><soapenv:Body><core:rectangle><length>" + "12"+ "</length><breadth>" + "10"+ "</breadth></core:rectangle></soapenv:Body></soapenv:Envelope>";
var url11 = "http://localhost:8090/area?wsdl";
$.ajax({
type: "POST",
url: url11,
contentType: "text/xml; charset=\"utf-8\"",
dataType: "xml",
data: soapRequest,
processData: false,
success: processSuccess,
error: processError
});
});
});
function processSuccess(data, status, req) {
if (status == "success")
alert(req.responseText + " @@@" + status);
$("#response").text();
}
function processError(data, status, req) {
alert(req.responseText + " " + status);
}
</script>
</head>
<body>
<h3>
Calling Web Services with jQuery/AJAX
</h3>
<input id="btnCallWebService" value="Call web service" type="button" />
<div id="response" />
</body>
</html>
This code working from IE and am getting response alert as xml format. But its not working on mozilla..whats wrong with this code. can you please help me out. Thanks in advance