开发者

How to call an external webservice in asp.net MVC

I want to call an external webservice. How do I do this in an asp.net mvc program? What options do I ha开发者_如何转开发ve. Does anyone have an example?

Thanks.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜