惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
博客园 - Franky
J
Java Code Geeks
V
Visual Studio Blog
G
Google Developers Blog
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Recent Announcements
Recent Announcements
Last Week in AI
Last Week in AI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
博客园 - 【当耐特】
IT之家
IT之家
I
InfoQ
U
Unit 42
C
Check Point Blog
Martin Fowler
Martin Fowler

博客园 - .NET易拉罐

MySQL性能优化的21个最佳实践 和 mysql使用索引(转) InnoDB锁问题 mysql锁表监控 postgresql的表导入数据后 主键值重复的解决 胃病验方 POSTGRESQL学习----函数返回结果集 利用winapi从dll资源中加载对话框 openh323的视频捕获原理 vs2003 + wxWidGets进行c++开发的环境配置 使用php-5.2.1-win32安装包配置iis+mysql运行环境 windows2003中asp网站配置问题 OpenVpn的服务器端的ip配置问题 - .NET易拉罐 JavaScript操作Cookie 双击驱动器无法打开的问题解决方法 让IIS服务器支持中文文件名 XPath手册 web应用程序bin目录下的dll无法加载问题解决方法 关于系统进程lsass.exe的病毒问题 给webservice方法添加soapHeader
使用微软的webservice.htc组建访问webservice
.NET易拉罐 · 2006-09-05 · via 博客园 - .NET易拉罐

主要用到了其中的两个方法
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>