如何通过 ajax 调用特定的 WSDL 方法。我有以下服务:
http://newsite.wrapcompliance.org/FactoriesWS.wsdl
我正在尝试调用该方法factCountByCountryID()
,该方法在给定 3 个字符串时返回一个整数。到目前为止的代码如下:
<h3>jQuery Test</h3>
<script type="text/javascript">
function callService()
{
$.ajax
({
url: "http://newsite.wrapcompliance.org/FactoriesWS.wsdl",
type: "POST",
dataType: "html",
data: {"countryCd":"BGD"},
success: processData,
error: onError
});
return false;
}
function processData(xml)
{
alert(xml);
}
function onError(request, status, error)
{
alert("It didn't work!!!");
}
</script>
<form method="post" action="">
<input type="button" value="Do it now!!" onclick="callService(); return false"/>
</form>