JSON-PRC 2.0 specification: http://www.jsonrpc.org/specification
See JsonRpc.Example project.
[ServiceContract]
interface ISimpleService
{
[OperationContract]
string SimpleMethod(string str);
}
class SimpleService : ISimpleService
{
public string SimpleMethod(string str)
{
return "Hello " + str;
}
}
// ...
var baseUri = new Uri("http://" + Environment.MachineName + ":8085/simplesvc");
var host = new ServiceHost(typeof(SimpleService), baseUri);
ServiceEndpoint ep = host.AddServiceEndpoint(typeof(ISimpleService), new JsonRpcHttpBinding(), "json-rpc");
ep.Behaviors.Add(new JsonRpcBehavior());
host.Open();
- TCP binding
- HTTPS binding
- Metadata
- Set correct error codes
UnwrapFaultException<T>
- Tests
- Batches (???)
- Configuration elements