Solved

When creating new web services, should I being using RESTful or SOAP or both?  JSON, XML, or both?

Posted on 2011-09-07
4
519 Views
Last Modified: 2013-11-18
I am creating and updating some web services for use by others and many of our other applications.  I've head RESTful is the way to do things now.  I need to use C# for these applications, so I figured on using Visual Studio 2010.  For the sake of appealing and being useful to a large user base potentially, should I make it work for both REST and SOAP?  Should objects be sent and returned using JSON, XML, or let the user decide and provide all combinations.  Will Visual Studio or other tools allow me to create the combinations without coding the interfaces four times?  Any ideas, links to tutorials, or books to make all this as flexible as possible would be very helpful.
0
Comment
Question by:mvhughes
4 Comments
 
LVL 6

Accepted Solution

by:
Rhino1272 earned 167 total points
Comment Utility
You definitely want to look at WCF.  You can create your service once and then add endpoints for each one of the scenarios described above.  The data format you pass back and forth depends upon what kind of data you use.  I personally prefer JSON because it is easily parsed by many popular JavaScript libraries.
0
 
LVL 17

Assisted Solution

by:sonawanekiran
sonawanekiran earned 167 total points
Comment Utility
The ASMX services were pretty Microsofty. Not to say that they didn't try to be compatible with other consumers; but the model wasn't made to fit much besides ASP.NET web pages and some other custom Microsoft consumers. Whereas WCF, because of its architecture, allows your service to have very open-standard--based endpoints, e.g. REST, JSON, etc. in addition to the usual SOAP. Other people will probably have a much easier time consuming your WCF service than your ASMX (web service) one.
0
 
LVL 9

Assisted Solution

by:Grant Spiteri
Grant Spiteri earned 166 total points
Comment Utility
Depends on the situation but personally my rule of thumb is SOA exposing Common functionality across multiple channels, using WCF with multiple variations of binding: http://msdn.microsoft.com/en-us/magazine/cc163394.aspx depending on the channel consuming.
0
 

Author Closing Comment

by:mvhughes
Comment Utility
Each of these was very helpful in its own way.  Thank you.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now