soap : function(att) {
var attr1 = att['attr1'];
var attr2 = att['attr2'];
var attr3 = att['attr3'];
var body = '<?xml version="1.0" encoding="utf-8" standalone="no"?>'
+ '<soap:Envelope schema_params>'
+ ' <soap:Body>'
+ ' <Operation xmlns=\"http://something.org/\">"
+ ' <Request>"
+ ' <data>"
+ ' <attr1>'+ attr1+'</ attr1>'
+ ' <attr2>'+ attr2+'</ attr2>'
+ ' <attr3>'+ attr3+'</ attr3>'
+ ' </data>'
+ ' </Request>'
+ ' </ Operation >'
+ ' </soap:Body>'
+ '</soap:Envelope>';
var formData = new FormData();
formData.append("externalwebconfigname", "theService");
formData.append("requestparams", "service="+att["service"]+"&type="+att["type"]); // will be appended to URL of externam web connection configuration
formData.append("requestbody", body);
formData.append("requestmethod", "POST");
formData.append("requestheader", "Content-type:text/xml; charset=utf-8");
formData.append("requestheader", "SOAPAction:http://something.org/Request");
formData.append("responsetype", "application/xml");
$.ajax({
url: "GetExternalWebInfo.jsp",
dataType : "xml",
type: 'POST',
enctype: 'multipart/form-data',
cache: false,
processData: false,
contentType: false,
data: formData,
async: false
})
.done(_.bind(function(data){
// Read and handle data
}, this))
.fail(_.bind(function(err, status, errStr){
alert("Request failed: " + errStr);
}, this));
}