Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you only want to develop a single web service and have it hosted on many different endpoints (i.e. SOAP + REST, with XML, JSON, CSV, HTML outputes). You should also consider using <strong><a href="http://www.servicestack.net" rel="noreferrer">ServiceStack</a></strong> which I've built for exactly this purpose where every service you develop is automatically available on on both SOAP and REST endpoints out-of-the-box without any configuration required.</p> <p>The <a href="http://www.servicestack.net/ServiceStack.Hello/" rel="noreferrer">Hello World</a> example shows how to create a simple with service with just (no config required):</p> <pre><code>public class Hello { public string Name { get; set; } } public class HelloResponse { public string Result { get; set; } } public class HelloService : IService { public object Any(Hello request) { return new HelloResponse { Result = "Hello, " + request.Name }; } } </code></pre> <p>No other configuration is required, and this service is immediately available with REST in:</p> <ul> <li>SOAP</li> <li><a href="http://www.servicestack.net/ServiceStack.Hello/hello/World!?format=xml" rel="noreferrer">XML</a></li> <li><a href="http://www.servicestack.net/ServiceStack.Hello/hello/World!?format=json" rel="noreferrer">JSON</a></li> <li><a href="http://www.servicestack.net/ServiceStack.Hello/hello/World!" rel="noreferrer">HTML</a></li> </ul> <p>It also comes in-built with <a href="https://github.com/ServiceStack/ServiceStack/wiki/HTML5ReportFormat" rel="noreferrer">a friendly HTML output</a> (when called with a HTTP client that has <strong>Accept:text/html</strong> e.g a browser) so you're able to better visualize the output of your services.</p> <p>Handling different REST verbs are also as trivial, here's a complete REST-service CRUD app in 1 page of C# (less than it would take to configure WCF ;):</p> <ul> <li><a href="http://www.servicestack.net/Backbone.Todos/" rel="noreferrer">Front-end TODO applicaiton</a></li> <li><a href="https://github.com/ServiceStack/ServiceStack.Examples/blob/master/src/Backbone.Todos/Global.asax.cs" rel="noreferrer">Back-end REST Service implementation</a></li> </ul>
 

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