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.
Jacke Elis36 pointsPosted Feb 1, 2015, 11:23 PM EST
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:
<root>
<Hello>World</Hello>
</root>
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.