Firstly, please excuse me for my bad english... I'll try to write correctly.
Here is my project : I use a WebService for some years. This WS need SOAP (XML) datas in entry. I have some code for create SOAP datas correctly and consume the AJAX response. I't s working on my PHP-Apache platform. I use JavaScript in client-side
Now, I would to call the same WebService from QlikView. I have read that is possible.
I created a static extenssion to familiarize a bit myself with QlikView and JS-API. And now, I would to use my WebService.
So let's go : this is my Script.js :
var wsurl = "http://imagin.heptago.com/imaginserver/ws/generateAdHocImageWS";
var wsurl_get = Qva.Remote + "?public=only&name=http://imagin.heptago.com/imaginserver/ws/generateAdHocImageWS";
var html = ""; // the html body of the extenssion.
Qva.AddExtension('CallImaging', function() {
Qva.LoadScript(Qva.Remote + "?public=only&name=Extensions\Objects\HelloWorld\jquery.js" , function() {
alert("jQuery up"); // work!
});
html += "<p>A QlikView Extenssion that call a WebService</p>";
var soapBody = soapData('login','pwd','portfolioName','serviceName', 'name', 'value');
//html += convertForShow(soapBody); // soap body ok!
$.ajax({
type: "post",
url: wsurl_get,
data: soapBody,
async : false,
success: function( msg ){
alert("Success");
},
error: function(XMLHttpRequest,textStatus, errorThrown){
alert("error : " + textStatus + "\nerrorThrown : " + errorThrown);
}
});
html += "<p>Call finished</p>";
this.Element.innerHTML = html;
});
And it's doesn't work. In this case, $ajax fall in error. But the message is not very explicit :
error : error
errorThrown : undefined
But the static text in <p> appears.
If I use the url wsurl instead, on post method too, I have nothing. No error message, no static text (extenssion panel stay blank).
By the way, I tried the all 4 combinations :
- Post + wsurl = nothing ;
- Post + wsurl_get = error message shown above ;
- Get + wsurl = nothing ;
- Get + wsurl_get = QlikView crash (...).
I'm turning around in two weeks. I have soon no hair on my head.
That's why I solicits your help.
Thanks you in advance.
Patrick
PS: I use QlikView 11.