You are viewing limited content. For full access, please sign in.



calling workflow web service from Forms javascript

asked on February 22, 2020 Show version history


I am trying to call Workflow Web service from Forms javascript, the calling went successfully from Internet Explorer but fails from Chrome and Firefox with the below error:


Access to XMLHttpRequest at '' from origin 'http://localhost' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

jquerymin?v=NNvRrt_4VTUxpB0IOMoCb0a7YmcdZ5YTm3OVRV8yIMU1:1 POST net::ERR_FAILED
send @ jquerymin?v=NNvRrt_4VTUxpB0IOMoCb0a7YmcdZ5YTm3OVRV8yIMU1:1
ajax @ jquerymin?v=NNvRrt_4VTUxpB0IOMoCb0a7YmcdZ5YTm3OVRV8yIMU1:1
(anonymous) @ 0:198
dispatch @ jquerymin?v=NNvRrt_4VTUxpB0IOMoCb0a7YmcdZ5YTm3OVRV8yIMU1:1
a.handle @ jquerymin?v=NNvRrt_4VTUxpB0IOMoCb0a7YmcdZ5YTm3OVRV8yIMU1:1



here is my javascript code:



       var datarequest2= '{\
        "FullPath":"String content",\
        "Server":"String content"\
        "Value":"' + $('#q252 input').val() + '"\
        "Value":"' + $('#q16 select').val() + '"\
        "Value":"' + $('#q262 input').val() + '"\
        "Value":"' + $('#q216 input').val() + '"\
        "Value":"' + $('#q53 input').val() + '"\

             type: "POST",
                data: datarequest2,
             contentType: "application/json; charset=utf-8",
             dataType: "json",

     success: function processSuccess(data, status, req) {
       var result =  req.responseText;
        // alert(req.responseText + " " + status); 
      alert("Message Sent");

             failure: function (response) {

                // alert("failed" + response.d);
               alert("Failed to Send Message");




Note: I already added the below in the workflow web server web config file


      <add name="Access-Control-Allow-Origin" value="*" />
      <add name="Access-Control-Allow-Headers" value="Content-Type" />




any help is appreciated.




1 0


replied on February 25, 2020 Show version history

Chrome and Firefox have stricter built-in CORS restrictions. If you want to disable Chrome's CORS security, there are instructions on how to do so in this StackOverflow post.

Before troubleshooting the browser issues further though, I would update your setup to use HTTPS for the Workflow Web Service and replace the localhost and IP references with the actual FQDNs. 

Edit: You are almost certainly running into the fact that Chrome does not support CORS for localhost requests. While you can disable Chrome security, you should update the localhost and IP references to address the root cause as I suggested above.



0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.