XML データを返すジャージ Web サービスを呼び出そうとしています。呼び出しは、次の形式の jquery ajax 呼び出しで行われます。
$.ajax({
type: "GET",
url: "http://localhost:8080/store/api/categoryservice",
contentType: "application/xml; charset=utf-8",
dataType: "xml",
success: function(resp){
alert("Hello");
}
failure: function(errMsg) {
alert(errMsg);
}
});
ナビゲーターに URL を入力すると、ブラウザーに次の形式の xml が表示されます。
<categoryBeans>
<categoryBean>
<code>1</code>
<name>Nutella</name>
</categoryBean>
<categoryBean>
<code>2</code>
<name>Kinder</name>
</categoryBean>
</categoryBeans>
しかし、html5 アプリから Ajax 呼び出しを行うと、何も返されません。
ajax 呼び出しをデバッグするにはどうすればよいですか?ajax 呼び出しは正しいですか?
乾杯