XMLHTTPRequest Issue in Chrome

182 views
Skip to first unread message

Kongu Ram Prakash

unread,
Dec 6, 2017, 5:28:06 AM12/6/17
to Google Chrome Developer Tools
Hi Team,

When we tries to hit the below code from IE it works fine, the same code i tried in Chrome it throws "Failed to load https://test/newtest.svc: Response for preflight has invalid HTTP status code 400" and OPTIONS https://test/newtest.svc 400 (Bad Request)


    var xmlhttp = new XMLHttpRequest();
    xmlhttp.open('POST', "https://test/newtest.svc", true);
    var soapMessage ='<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:lpk="http://testintegeration.test">   <soapenv:Header/>   <soapenv:Body>      <testintegeration>         <UserID>ad</UserID>      </testintegeration>   </soapenv:Body></soapenv:Envelope>'
    xmlhttp.onreadystatechange = function () {
        if (xmlhttp.readyState == 4) {
            if (xmlhttp.status == 200) {
                alert('Success');
            }
        }
    }
    xmlhttp.setRequestHeader('Access-Control-Allow-Origin', '*');
    xmlhttp.send(soapMessage);

Could you please help me in fixing this issue

PhistucK

unread,
Dec 6, 2017, 5:30:35 AM12/6/17
to Google Chrome Developer Tools
This is the wrong group. Please, use stackoverflow.com for web development issues. If you are pretty sure this is a Chrome issue, use crbug.com to report it as an issue (or star an existing issue, if you can find a similar one).

Note - please, continue the discussion elsewhere. You can reply with a link to the found or created issue.
Also, try to give a URL to a complete page instead of making the ones who help you combine the pieces themselves. This makes sure any server issues are still apparent, which may affect the rendering.


PhistucK

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-developer-tools+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/e08382c3-2f9d-4fae-bbcd-e8bf1aa0856f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages