0

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.

0

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!");
    }
});

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.