我怎样才能从JavaScript调用Web服务方法? [英] How can I call web service methods from javascript?
问题描述
有没有办法从JavaScript调用Web服务?我知道你可以在脚本中添加经理在Web服务来拉,但我无法弄清楚如何使用JavaScript访问的功能,一旦我做到了这一点。
Is there any way to call web services from javascript? I know you can add in a script manager to pull in the web services but I can't figure out how to access the functions from javascript once I've done that.
谢谢,
马特
Thanks,
Matt
推荐答案
请参阅<一个href=\"http://www.asp.net/AJAX/Documentation/Live/Tutorials/ConsumingWebServicesWithAJAXTutorial.aspx\">Calling Web服务从客户端脚本的ASP.NET AJAX :
本主题介绍如何使用调用
从ECMAScript中的Web服务
(JavaScript的)。为了使您的
应用程序调用ASP.NET AJAX的Web
通过使用客户端脚本的服务,
服务器异步通信
层自动生成
JavaScript代理类。代理
每个Web生成类
服务其中
&LT; ASP:服务引用&GT;
元素
根据包括
&LT; ASP:ScriptManager的&GT;
在控制
页。
This topic explains how to use to call a Web service from ECMAScript (JavaScript). To enable your application to call ASP.NET AJAX Web services by using client script, the server asynchronous communication layer automatically generates JavaScript proxy classes. A proxy class is generated for each Web service for which an
<asp:ServiceReference>
element is included under the<asp:ScriptManager>
control in the page.
这篇关于我怎样才能从JavaScript调用Web服务方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!