Note that there are some explanatory texts on larger screens.

plurals
  1. POCross domain issue XMLHttp
    text
    copied!<p>I face the common cross domain issue with xmlhttp. </p> <p>I am trying to access WSDL web service using the SOAP protocol. I am not using php and so I can not use the </p> <pre><code>header('Access-Control-Allow-Origin: *'); </code></pre> <p>I also can't use JSONP as the response I get is not in JSON format but in XML format. Is there any other way that I can resolve this issue. </p> <p>Here is my code snippet. </p> <pre><code>var user1="user_name"; var pass1="******"; var url="http://ideone.com/api/1/service.wsdl"; var soap_msg="&lt;?xml version='1.0' encoding='UTF-8' standalone='no'?&gt;"+ "&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'"+ "xmlns:tns='http://ideone.com:80/api/1/service' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'"+ "xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'"+ "xmlns:soap-enc='http://schemas.xmlsoap.org/soap/encoding/' "+ "xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' &gt;"+ "&lt;SOAP-ENV:Body&gt;&lt;mns:getLanguages xmlns:mns='http://ideone.com:80/api/1/service' SOAP- ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'&gt;"+ "&lt;user xsi:type='xsd:string'&gt;"+user1 +"&lt;/user&gt;&lt;pass xsi:type='xsd:string'&gt;"+pass1+"&lt;/pass&gt;"+ "&lt;/mns:getLanguages&gt;&lt;/SOAP-ENV:Body&gt;&lt;/SOAP-ENV:Envelope&gt;"; var oXmlHttp= new XMLHttpRequest(); oXmlHttp.open("POST",url,true); oXmlHttp.setRequestHeader("Content-Type", "text/xml"); oXmlHttp.setRequestHeader("SOAPAction", "http://ideone.com/api/1/service#getLanguages"); oXmlHttp.setRequestHeader("Access-Control-Allow-Origin", "*"); oXmlHttp.send(soap_msg); var res=oXmlHttp.responseXML; </code></pre> <p>Thanks in advance. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload