Skip to content

Instantly share code, notes, and snippets.

@manjeshpv
Last active November 1, 2023 11:53
Show Gist options
  • Save manjeshpv/539c8e253f24cde0bcbc to your computer and use it in GitHub Desktop.
Save manjeshpv/539c8e253f24cde0bcbc to your computer and use it in GitHub Desktop.
Soap Request AJAX jQuery
var soapAction = " http://server.test.nam/RequestHandler/reverseYourName "
var soapRequestBody = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://server.test.nam"> <soapenv:Header/> <soapenv:Body> <ser:reverseYourName> <ser:name>test</ser:name> </ser:reverseYourName> </soapenv:Body> </soapenv:Envelope>'
$.ajax({
url: "http://10.23.249.55:8282/WebServiceForServer/services/RequestHandler",
type: "POST",
data: soapRequestBody,
beforeSend: function(xhr) {
xhr.setRequestHeader("SOAPAction", soapAction)
},
success: function(response) {
console.log(response)
},
error: function(err) {
console.log(err)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment