I have the following code to execute a SOAP request with an wsse header but it seems not to work. I get a error response but I am not able to get the fault/error out of the response.
Does the below code look correct or do I miss something?
var request = "<soapenv:Envelope" +
"xmlns:dlg='http://dlg123Lib'" +
"xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>" +
"<soapenv:Header>" +
"<wsse:Security" +
"xmlns:wsse='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'" +
"xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'>" +
"<wsse:UsernameToken wsu:Id='UsernameToken-BF09AFF37A2C36D4AB164000000000000000'>" +
"<wsse:Username>BLABLABLA</wsse:Username>" +
"<wsse:Password Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'>BLABLABLA</wsse:Password>" +
"</wsse:UsernameToken>" +
"</wsse:Security>" +
"</soapenv:Header>" +
"<soapenv:Body>" +
"<dlg:getData>" +
"<name>AB</name>" +
"</dlg:getData>" +
"</soapenv:Body>" +
"</soapenv:Envelope>"
jQuery.ajax({
url: 'https://endpoint_url/dlg/data',
type: "POST",
data: request,
dataType: "xml",
contentType: "text/xml; charset='utf-8'",
success: function (soapResponse) {
alert("Success");
},
error: function (soapResponse) {
alert("Error");
}
});
thank you for any hint!