SOAP Calls using jQuery Ajax

Few days ago, I came across a situation where I had to get data from a .NET Web Service using jQuery Ajax. Here is a sample code:

var soapMessage =
    '<soap:Envelope xmlns:xsi="" xmlns:xsd="" xmlns:soap="">'+
                '<Arg1>Arg1 Value</Arg1>'+
                '<Arg2>Arg2 Value</Arg2>'+

    url: "http://localhost/someService.svc",
    type: "POST",
    dataType: "xml",
    contentType: "text/xml; charset=\"utf-8\"",
    headers: {
        SOAPAction: "http://localhost/someService/SomeMethod"
    data: soapMessage,
    success: function(soapResponse){
        //DO SOMETHING

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>