yxh1122

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  17 随笔 :: 1 文章 :: 1 评论 :: 0 引用
主要用到了其中的两个方法
1、 service.useService({webservice地址},{本地的webservice代理类名})
2、service.{本地的webservice代理类名}.callService({本地的回调函数},{要调用的webservice方法名},{需要为方法传递的参数})
callService方法中的第一个参数为本地的回调函数,通过此函数可以对调用webservice返回的结果作相应的处理
<html>
<head>
</head>
<script language="javascript">
function ShowResults()
{
 var result;
 //service.useService({webservice location},{webservice class name})
 service.useService("http://localhost/WebApplication1/WebService1.asmx?WSDL","helloSevice");
 //service.Service.callService({webmethod},{input parameters needed})
 service.helloSevice.callService(ShowResult,"HelloWorld",null);
}
function ShowResult(result)
{
 window.alert(result.value);
}
</script>
<body>
<div id="service" style="behavior:url(webservice.htc)" ></div>
<input type="button" value="callWebservice" onclick="ShowResults()"/>
</body>
</html>
posted on 2006-09-05 17:48 .NET易拉罐 阅读(256) 评论(0)  编辑 收藏 网摘



发表评论

昵称: [登录] [注册]

主页:

邮箱:(仅博主可见)

评论内容:

  登录  注册

[使用Ctrl+Enter键快速提交评论]

0 495559




相关文章:

相关链接: