Click here to Skip to main content
11,798,866 members (56,223 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET C#4.0

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

Thanks and Regards,
Posted 9-Jan-13 1:48am
Edited 9-Jan-13 2:04am
aspnet_regiis -i at 9-Jan-13 7:52am
what ?
ajay.anilmaddi at 9-Jan-13 8:05am
How to call the Webservice(WebMethods)?
ryanb31 at 9-Jan-13 8:28am
There is no best way, that depends on what you are doing. Can you be more clear on exactly what you need?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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)

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.


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 ]
Marcus Kramer at 9-Jan-13 9:15am
Krunal Rohit at 9-Jan-13 9:17am
Thanks Marcus...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 CPallini 465
1 OriginalGriff 378
2 Maciej Los 305
3 Richard MacCutchan 281
4 phil.o 244
0 OriginalGriff 2,270
1 Maciej Los 1,810
2 KrunalRohit 1,496
3 CPallini 1,425
4 Richard MacCutchan 1,109

Advertise | Privacy | Mobile
Web02 | 2.8.151002.1 | Last Updated 9 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100