Web服务和webmethods [英] Webservice and webmethods

查看:80
本文介绍了Web服务和webmethods的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我们可以在网络服务中调用webmehod多少种方式?

哪种方式最好?





谢谢和问候,

Anilkumar.M

Hi ALL,

How many ways we can call webmehod in web service?
Which is the best way ?


Thanks and Regards,
Anilkumar.M

推荐答案

如果Web服务是基本的asmx web服务,那么您可以使用WSDL.exe工具为XML Web服务创建客户端代理类,并将此生成的客户端代理类添加到您的项目中,最后您可以使用Web方法网络服务。



1,网络服务描述语言工具(Wsdl.exe)

http://msdn.microsoft.com/en-us/library/7h3ystb6(v=vs.71).aspx



如提到的suresh_g_v2002,您还可以使用ScriptManager异步调用Web服务或WCF REST服务。



2,使用jQuery使用WCF / ASMX / REST服务

使用jQuery使用WCF / ASMX / REST服务



如果Web服务是普通的WCF服务,你可以直接添加服务引用项目资源管理器或使用svcutil.exe生成客户端代理类。







在.Net中没有添加对我们可以通过以下方式调用的项目的引用



1.使用System.Net namspace的HttpWebRequest ..,



2.我们也可以使用Scriptmanager异步调用webservice。



[比特googling 可以解决问题]
If the web service is basic asmx web serivce,then you can use WSDL.exe tool to create client proxy class for the XML Web service and add this generated client proxy class to your project,finally you can use the web method of web service.

1,Web Services Description Language Tool (Wsdl.exe)
http://msdn.microsoft.com/en-us/library/7h3ystb6(v=vs.71).aspx

As suresh_g_v2002 mentioned, you can also call Web Service or WCF REST Service asynchronously using ScriptManager.

2,Consuming a WCF / ASMX / REST Service using jQuery
Consuming a WCF / ASMX / REST Service using jQuery

If the web service is ordinary WCF service,you can directly add service reference within the project explorer or use svcutil.exe to generate client proxy class.

and

In .Net without adding reference to the project we can call in the following ways

1. Using HttpWebRequest of System.Net namspace..,

2. We can also call webservice asynchronously using Scriptmanager.

[ Bit of googling can solve the problem ]


这篇关于Web服务和webmethods的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆