Hello there,
How to make web service in xdp file work after the xdp file is converted to HTML form?
For example, the xdp contains javascripts (or use ConnectionSet) to call web service
form1.#subform[0].Button1::click - (JavaScript, server)
var countryTextField = "AFK";
var cURL = "http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL";
SOAP.wireDump = false;
var service = SOAP.connect(cURL);
var Input = {sCountryISOCode:countryTextField};
var result = service.FullCountryInfo(Input);
tfCurrency.rawValue = result.sCurrencyISOCode;
tfCapital.rawValue = result.sCapitalCity;
Is there any way make the web service working in previewHTML or HTML form converted from xdp?
Please suggest.
Thanks in advance.
Harry
Solved! Go to Solution.
Views
Replies
Total Likes
xfa.connectionSet won't work in this case, if rendered at client but you can make a web service call if the script is rendered at server. Yes, if the requirement is to run the script at the client, then you can make an Ajax call to the webservice as below:
if (typeof(xfa.connectionSet)=="undefined") {
var data = new FormData();
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange=function() {
//Custom logic//
}
};
xhttp.open("POST", http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL, true);
xhttp.send(data);
}
else {
xfa.connectionSet.LookupUser.execute(0);
}
Hope that helps!
xfa.connectionSet won't work in this case, if rendered at client but you can make a web service call if the script is rendered at server. Yes, if the requirement is to run the script at the client, then you can make an Ajax call to the webservice as below:
if (typeof(xfa.connectionSet)=="undefined") {
var data = new FormData();
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange=function() {
//Custom logic//
}
};
xhttp.open("POST", http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL, true);
xhttp.send(data);
}
else {
xfa.connectionSet.LookupUser.execute(0);
}
Hope that helps!
Views
Replies
Total Likes
Views
Likes
Replies