I'm using Sharepoint 365. I would like to call a WCF Service located in a server in my intranet to read data using a script editor webpart and jquery ajax. Anyone has any example of how to accomplish this? I have read that using jsonp and cross-domains but hadn't found any good example. Thanks in advance. Regards.
1 Answer
I used these block code to call an application installed in the client and configured to listen a port on the localhost, from a page with a form published in Sharepoint Online. In this case I had to asign "http://localhost:xxxx" to call_UrlEndpoint, but try to put your intranet url instead.
function openLocalApp(call_UrlEndpoint, dataJson){
$.ajax({
url: call_UrlEndpoint,
type: 'POST',
async: true,
data: JSON.stringify(dataJson),
jsonp:"callback",
jsonpCallback: "save",
contentType: 'application/json',
processData: false,
crossDomain: true,
dataType: 'jsonp',
succes: function (response) {
alert("Success");
},
error: function (response) {
alert("Scanning component failed!");
}
});
}
-
-
Maybe this can be useful... social.technet.microsoft.com/wiki/contents/articles/…Ernesto Meneses– Ernesto Meneses2019-06-29 04:53:09 +00:00Commented Jun 29, 2019 at 4:53