2012-01-14 23 views
4

Phonegap AndroidアプリからWebサービスを呼び出す際にこのエラーが発生します。ここでヌルのプロパティ 'documentElement'を読み取ることができません

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

は、関連するコードです:

var ns = (wsdl.documentElement.attributes["targetNamespace"] + "" == "undefined") ? 
wsdl.documentElement.attributes.getNamedItem("targetNamespace").nodeValue : 
wsdl.documentElement.attributes["targetNamespace"].value; 
+0

'wsdl.documentElement'のように見えますが、エラーからヌルです。したがって、 'wsdl'がどのように設定されているか、' documentElement'というプロパティがあるかどうかを確認してください –

答えて

1

それがあるため、クロスドメインリクエストの、CORS ので、あなたのheades

Accept: Access-Control-Allow-Origin 

ORも使用にそれを含める必要がありますどちらか

chrome.exe --disable-web-security 

ORまた、あなたがクロームextenstion

Enable cors request extention in chrome

をインストールすることができ、それが役立つことを願っています。

関連する問題