1
Reply

What is restful webservice? Difference b/w xml webservice, wcf web service and resfulwebservice?

haider ali

haider ali

13y
6.9k
0
Reply

    It's often hard for people to "get" REST, this is mostly due to the fact that REST isn't a tangible thing like a piece of software or even a specification, it's a selection of ideals, of best practices distilled from the HTTP specs.

    I've always found that the best way to understand something is to see an example, to see the principles in action first and worry about the details later once I understand the general gist. So here's a little example of a Restful version of a simple Web service you might already know about, the api.


    • Only Public fields or Properties of .NET types can be translated into XML.
    • Only the classes which implement IEnumerable interface.
    • Classes that implement the IDictionary  interface, such as Hash table can not be serialized.

    The WCF uses the DataContractAttribute and DataMemeberAttribute to translate .NET FW types in to XML.

    [DataContract]
    public class Item
    {
    [DataMember]
    public string ItemID;
    [DataMember]
    public decimal ItemQuantity;
    [DataMember]
    public decimal ItemPrice;

    }

    bca final year projects