上一篇:无法加载DLL(OCI.DLL),如何解决? >>
Calling WebServices using javascript
To use the "WebService" behavior, you must attach it to an element using the STYLE attribute, as follows:
<DIV ID="GiveItAName"
STYLE="behavior:url(webservice.htc)"></DIV>
A complete example taken from the Microsoft Web site is as follows:
<html>
<head>
<script language="JavaScript">
var iCallID;
function init()
{
service.useService
("http://myserver.com/services/myservice.asmx?WSDL",
"servicename");
}
function onmyresult()
{
if ((event.result.error)&&(iCallID==event.result.id))
{
var xfaultcode = event.result.errorDetail.code;
var xfaultstring = event.result.errorDetail.string;
var xfaultsoap = event.result.errorDetail.raw;
// Add code to output error information here
alert("Error ");
}
else
{
service.innerHTML= "The method returned the result: "
+ event.result.value;
}
}
</script>
</HEAD>
<body onload="init();">
<BR>
Enter a Value <input type=‘’text‘’ id=‘’param1‘’>
<BR>
<button onclick=‘’iCallID = service.servicename.callService
("ProcedureName", param1.value);‘’>Call A Web Method</button>
<div id="service"
style="behavior:url(webservice.htc)"
onresult="onmyresult();">
</div>
</body>
</html>
下一篇:Session过期问题 >>
相关文章:
- · ASP 写的自动生成SELECT 表单的函数
- · ASP 写的判断 Money 各个位值的函数
- · 如何保存一个字符串Cookie,在其它WebForm中可以访问到?
- · 几个开源项目配置信息的存储和处理的方式
- · [ASP-Last-Code]显示ASP页面的代码
- · C#实现WEB服务器
- · 一个完整的案例
- · 自定义DataGrid分页设置
- · 虚拟主机如何提高整体性能-application的使用
- · 我的DataGrid嵌套DataList(未解决)
- · 大文件上传研究
- · IIS属性大全
- · 在Asp程序中取得表单所有内容的方法
- · 发布攻击台湾国旗设计网的ASP代码
- · ADO.NET 2.0 Feature Matrix
- · asp.net中的模态对话框
- · ASP.net中动态加载控件时一些问题的总结
- · 一切都因为分页-再谈分页
- · 简单快捷实现ASP在线发邮件功能
- · 改进性能和样式的 25+ ASP 技巧
- · 我的asp之路
- · 网上考试系统的一点心得
- · asp程序错误详细说明例表
- · 用好活动字幕标记—marquee
- · asp.net实现分组全选部分复选框
- · 在PPC上编译ASP,吃惊!!!
- · Asp之Request对象(1)
- · 汉字转拼音
- · 在ASP文件中调用DLL
- · 存储过程介绍及asp存储过程的使用
- · 如何把ASP编写成DLL
- · Asp.Net下导出/导入规则的Excel(.xls)文件
- · 我写ASP时常用到的一些函数(2)
- · asp 中处理异常
- · asp
- · ASP.Net Web Page深入探讨
- · IIS6 和Tomcat5 的整合
- · 浅谈如何建立三层体系结构的ASP应用程序
