开发者

Converting a SOAP Web Service to an RESTful Web Service using ASP.NET MVC?

I'm developing software for clients who want my PHP-based software to interact with web services they develop and host on their ASP.NET-based servers. Typically these clients developers tell me "Here is the SOAP web service you need" which I unfortunately find very problematic.

What I am developing are WordPress plugins but please don't migrate this question to WordPress Answers; it's an ASP.NET question. RESTful web services would be so much easier to support once tens, hundreds and/or thousands of non-technical end-users download and install these potential plugins that would by-nature need to contain an embedded SOAP client that I fear would become fragile in the face of so many different execution environments and shared web hosts.

What I'd like to see as an answer for this question is an example of a simple SOAP web service that encapsulates a function call something like getProduct() and an equivalent RESTful web service implemented using ASP.NET MVC that allows an HTTP GET of a URL path, something like /products/{product}/.

The internals of how to get the product are unimportant for this question, but a basic implementation that could be copied and tested would actually be nice (And yes, I know there is an impedance mismatch between RPC-based SOAP and a RESTful web service; your answer will ideally take that into consideration.)

If I have such an example showing the implementation of two ve开发者_如何学Cry simple web services, one using SOAP and one RESTful then hopefully I'll be able to show my prospective client's developers how easy it is to implement a RESTful web service using ASP.NET MVC. Maybe I'll no longer get the pushback I've been getting from ASP.NET developers who know how to create a SOAP endpoint but who are simply unfamiliar with RESTful web services.

And finally, if you have other ideas about how to present a persuasive argument to get ASP.NET developers who have been immersed in Visual Studio to explore creating RESTful web services then I'm all ears. Thanks in advance for your help.


Note: I'd prefer to see RESTful web services using ASP.NET MVC and not WCF. Also note that this question is related to all of these following questions I asked elsewhere:

  • **On [WordPress Answers][1]:**
    • *[**"Pitfalls when Distributing Plugins that Access SOAP Web Services?"**][2]*
    • *[**"Embedding a SOAP Client into a WordPress Plugin?"**][3]*

  • **On [Programmers][6]:**
    • *[**"Convincing a Client to Offer a RESTful Web Service instead of a SOAP Service?"**][7]*

  • **On [Namesake][4]:**
    • *[**"Do you have experience with building RESTful web services with ASP.NET using MVC and/or WCF and if so what can you tell people who default to building their web services in SOAP because they are unaware of REST?"**][5]*
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜