Note that there are some explanatory texts on larger screens.

plurals
  1. POWcf. Rest. Architecture. Need advice
    text
    copied!<p>Suppose I have this simple contract which I've taken from MS examples and altered a bit:</p> <pre><code> [ServiceContract(SessionMode = SessionMode.Allowed)] public interface IService { [WebInvoke(Method = "POST", UriTemplate = "", ResponseFormat = WebMessageFormat.Xml, RequestFormat = WebMessageFormat.Xml), Description( "Adds a customer to customers collection. The response Location header contains a URL to the added item.")] [OperationContract] Customer AddCustomer(Customer customer); [WebInvoke(Method = "DELETE", UriTemplate = "{id}"), Description( "Deletes the specified customer from customers collection. Returns NotFound if there is no such customer.") ] [OperationContract] void DeleteCustomer(string id); [WebGet(UriTemplate = "{id}"), Description( "Returns the specified customer from customers collection. Returns NotFo`enter code here`und if there is no such customer.") ] [OperationContract] Customer GetCustomer(string id); [WebGet(UriTemplate = ""), Description("Returns all the customers in the customers collection.")] [OperationContract] List&lt;Customer&gt; GetCustomers(); [WebInvoke(Method = "PUT", UriTemplate = "{id}"), Description("Updates the specified customer. Returns NotFound if there is no such customer.")] [OperationContract] Customer UpdateCustomer(string id, Customer newCustomer); } </code></pre> <p>I need this contract to expose over webhttp REST and over nettcp binding (with sessions).</p> <p>My case(contract) is much harder, so I need to understand whether to have one implementation for both purposes and differentiate somehow between webhttpbinding call or nettcpbinding call or provide different realizations for each endpoint.</p> <p>Thanks in advance</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload