What are the different ways to consume web service in ASP.net and which one is best and why

Posted by Sonalmisra under Web Services, Remoting on 1/9/2015 | Points: 10 | Views : 4325 | Status : [Member] | Replies : 4
I have a Web service and need to consume it . One way I know is by adding web reference . What are other ways to consume it and what are different advantages and disadvantages of it.




Responses

Posted by: vishalneeraj-24503 on: 1/9/2015 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Hi,
You can used Ajax webservice to consume.
Go to the below link:-
http://www.webreference.com/programming/asp/Ajax_WebService/index.html

Sonalmisra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: vishalneeraj-24503 on: 1/9/2015 [Member] [MVP] Platinum | Points: 25
Posted by: Sonalmisra on: 1/9/2015 [Member] Starter | Points: 25

Up
0
Down
Hi Vishal ,
Thanks for your response.
Actually for consuming webservice through AJAX , webservice should be marked as [ScriptService] attribute.
I already got webservice that can't be changed and I have to consume it . So for that I need different approaches to consume . And one more thing that web service needs authentication i.e. user name and password.
Please help me on this.

Sonalmisra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 1/12/2015 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
Use the add web-reference its the managed way of consuming a webservice and it is easy to debug when things goes wrong

Thank you for posting at Dotnetfunda
[Administrator]

Sonalmisra, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response