Cannot read property "documentElement" of null property

I get this error when calling Webservice from Android Phonegap application.

01-13 23: 49: 52.219: E / Web Console (529): Uncaught TypeError: cannot read the documentElement property of the null property in the file: ///android_asset/www/soapclient.js: 158

Here is the relevant code:

var ns = (wsdl.documentElement.attributes["targetNamespace"] + "" == "undefined") ? wsdl.documentElement.attributes.getNamedItem("targetNamespace").nodeValue : wsdl.documentElement.attributes["targetNamespace"].value; 
+4
source share
1 answer

this could be due to a cross domain request, CORS so either you have to include it in your head

 Accept: Access-Control-Allow-Origin 

OR also use

 chrome.exe --disable-web-security 

OR also you can install chrome extenstion

Enable cors request extension in chrome

Hope this helps.

+1
source

Source: https://habr.com/ru/post/1390952/


All Articles