in Education by

What is REST and how to create a WCF RESTful Service ?

1 Answer

0 votes
by

REST-

Representational State Transfer (REST) is a protocol for exchanging data over a distributed environment. The main idea behind REST is that we should treat our distributed services as a resource and we should be able to use simple HTTP protocols to perform various operations on that resource.

JSON

The JavaScript Object Notation (JSON) data format, or JSON for short, is derived from the literals of the JavaScript programming language. JSON helps us to present and exchange data in a self-descriptive, independent and light way. This data can then be easily consumed and transformed into JavaScript objects.

In most browser-based applications, WCF can be consumed using JavaScript, jQuery, AngularJS and so on. When a client makes a call to WCF, JSON or XML is used as the format of the communication. WCF has the option to send the response in JSON object. This can be configured with the WebGet orWebInvoke attribute and the WebHttpBinding. This allows you to expose a ServiceContract as a REST service that can be invoked using either JSON or plain XML.

  • GET: Retrieves the information.
  • PUT: Replaces the entire collection with another collection.
  • POST: Creates a new entry in the collection.
  • DELETE: Deletes the entire collection.

Related questions

0 votes
    How do we host a WCF service in IIS?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    What is a Service Proxy in WCF?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    What are the main components of WCF Service?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    What are the possible ways of hosting a WCF service?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    How to create Basic HTTP Binding in WCF?...
asked Apr 3, 2021 by JackTerrance
0 votes
    What is WCF Concurrency and How many modes are of Concurrency in WCF?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    What is Transaction Propagation? And how WCF support it?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    What is Security Implementation in WCF? How many are there?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    What are Contracts in WCF? How many Contracts are in WPF?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    What is SOA, and Messages in WCF?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    What is Information cards in WCF?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    What is Instance Management in WCF?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    What you understand by Fault Exception in WCF?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    What is Duplex in WCF? Explain also Message Exchange Pattern?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    What is WCF Messaging Layer?...
asked Apr 3, 2021 in Education by JackTerrance
...