Hi,

I would like to find sample code for web service call from javascript using ajax.

Can anyone help?

For example:

$(document).ready(function(){

$("#test").click(function(){

var soapRequest = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:typ=\"http://schemas.novell.com/2005/01/GroupWise/types\" xmlns:met=\"http://schemas.novell.com/2005/01/GroupWise/methods\">"
+ "<soapenv:Header>"
+ "<typ:gwTrace>true</typ:gwTrace>"
+ "</soapenv:Header>"
+ "<soapenv:Body>"
+ "<met:loginRequest>"
+ "<met:auth type=\"types:PlainText\">"
+ "<typ:username>xren</typ:username>"
+ "<typ:password>xxxx</typ:password>"
+ "</met:auth>"
+ "<met:version>1.04</met:version>"
+ "<met:application>Ebase</met:application>"
+ "<met:userid>true</met:userid>"
+ "<met:system>true</met:system>"
+ "</met:loginRequest>"
+ "</soapenv:Body>"
+ "</soapenv:Envelope>";

alert(soapRequest);

$.ajax({
type: "POST",
url: "http://192.168.245.173:7191/soap",
dataType: "xml",
contentType: "application/xml; charset=utf-8",
data: soapRequest,
success: function(xml){ alert("ok"); alert(xml);},
failuer: showError
});
})
})


Thanks,
Xiaoli