Write a program for the following string
1.Input string:"a + b %s -c #d+f &e"
Output string should be like this
output string:"{a,b,c} {d+e+f} "
2.Why JSON is light weight than XML?
3.Why we are using WEB API over WCF?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jacke ElisPosted Feb 2, 2015, 4:23 AM
1. Unfortunately I cannot help you with this one, I need more information about that content. I just don't see what logic is behind it, what does input represent and what is an output to it...
2. Every element in the XML tree has a name (the element type name or in other words a tag name) and every element must be enclosed in a matching pair of tags, so that is why it occupies more content with its information representation.
Or to put it simply in JSON you have:
{
"Hello":"World"
}
In XML you have:
So... JSON is smaller...
3. You can find a detailed comparison here, but in short WCF is primarily focused on creating SOAP based services while Web API is only focused on creating REST based services.