Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 04, 2012 07:23 PM by MartinJ.
Dec 03, 2012 07:37 PM|LINK
I want to build a web service that to expose an API which will be consumed by another company in a Java application. I am kind of undecided whether to use WCF (SOAP) or Web API (REST). The client should be able to do CRUD operations and some of those operations
involve credit card payments using our API. Also, I am planning to use the same web service to build an app for iphone/android.
What are the advantages/disadvantages of using SOAP vs REST in this scenario?
Is it harder to consume SOAP services on mobile devices ?
Most importantly, what's the best way to authenticate the client?
I really appreciate any help.
Dec 04, 2012 01:21 AM|LINK
I would suggest to use Web API. The main reason is because for mobile application the best way to consume services is using REST for which Web API is a perfect fit. WCF gives you the flexibility to use other protocols, but the REST implementation is a bit
When comparing SOAP vs REST, it has already been established (for many years) that REST is the better choice( lighter in size, uses the http verbs and routing techniques), and you can serialize to JSON.
Authentication is the same for both (WCF and Web API). You will need to pass credentials/tokens to ther server to maintain the authenticated state, but this should be decided based on your security requirements. For Web API, you can use a message handler
(my choice) or a authorization filter to handle the authentication and populate the user principal. Your controllers will just need to be decorated with the Authorize attribute for each action.
hope this helps.
Dec 04, 2012 03:01 AM|LINK
IMHO, consuming HTTP services(including REST and RPC) is very easier in every modern app. I was able to consume HTTP service from Andriod(Java), Iphone(Objective C), Windows Mobile 6(6.5 C# 3.0) clients very easily.
Dec 04, 2012 07:19 PM|LINK
RestFull is more widely use in the futre Then SOAP is going to dead.
Dec 04, 2012 07:23 PM|LINK
Most webservices are not REST. They perhaps are a little bit like REST, but usually they're just RPC style over HTTP. And there's absolutely nothing wrong with that!
I'd still stick to Web Api over WCF. It's easier to set up (web or selfhost), easier to configure (code, no configuration file) and easier to plug in (due to filter and dependency resolver).