在javascript中用微软的htc组件调用web service
2006-12-23 14:41 by BAsil, 334 visits, 收藏, 编辑
<script>
function init()

{
service.useService("http://localhost/YSGL/YSEstablish/YuSuanHistory.asmx?WSDL","test");
var iCallID = service.test.callService("getResult");
}
function onWSresult()

{
alert(event.result.value);
}
</script>
<body>
<div id="service" style="behavior:url(webservice.htc)" onresult="onWSresult()"></div>
</body>webservice
[WebMethod]
public string getResult()
{
return "Hello World";
}