Skip to main content
Nintex Community Menu Bar

Problem calling web service using jquery

  • September 19, 2015
  • 2 replies
  • 14 views

Forum|alt.badge.img+3

hi, I am trying to call web service from Nintex form using jqeury but it keeps giving error.

Any ideas on what the problem is below? thanks.The method name is checkEmail.

function checkEmail()

{

var webserUrl = 'http:/www.mywebservice.com/checkcontact.svc?singleWsdl';

var soapMessage = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"><soapenv:Header/><soapenv:Body><tem:CheckEmail><tem:Email>abc@test.com</tem:Email></tem:CheckEmail></soapenv:Body></soapenv:Envelope>'; 

                NWF$.ajax({

                    type: "POST",

                    url: webserUrl,

                    data: soapMessage,

                    contentType: "text/xml",

                    dataType: "xml",

                    success: SuccessOccur,

                    error: ErrorOccur

                });

        function SuccessOccur() {

           alert("worked");

        }

        function ErrorOccur() {

           alert("failed");

}

2 replies

Forum|alt.badge.img+9
  • Nintex Partner
  • September 24, 2015

What is the error that you get ?


Forum|alt.badge.img+3
  • Author
  • September 24, 2015

I was not getting any response back from the web service. After some research, I discovered it was because the ajax call was made to web service on different server and cross domain call using ajax is not supported unless something like CORS is implemented on the web service server.

It is working now, thanks.