1

I want to call an external webservice. How do I do this in an asp.net mvc program? What options do I have. Does anyone have an example?

Thanks.

Joe
  • 286
  • 1
  • 2
  • 13

2 Answers2

0

check out this article if you're calling your web service client side using jQuery.

It's done with JSON, but you could get XML by changing the dataType parameter to dataType: "xml" or not including it all as it is the default.

If you're doing it server side check out this article. It's VB.Net but you can easily translate it to C#

I hope this helps.

hunter
  • 62,308
  • 19
  • 113
  • 113
0

You call an external webservice in an ASP.NET MVC application the same way you call it in any .NET application. If it is a SOAP based service you generate a proxy class using svcutil.exe, if the service uses some proprietary XML you may need to resort to HttpWebRequest.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928