Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Consuming JSON-RPC web services in .NET

A business partner has suggested building a web services library with JSON-RPC rather that SOAP. (note they are not building in .NET necessarily, but I am)

I am a potential consumer of this data.

I've used JSON for client-based Ajax calls in the past, but this web services library will be used primarily for server-side calls and syncing large amounts of data.

I don't have much experience with JSON-RPC.

Questions:

  • Can I easily build a JSON-RPC consumer in .NET?
  • Are JSON-RPC web services self documenting and discoverable, like a SOAP WSDL?
  • Can I easily add a Web Reference in Visual Studio to a JSON-RPC web service?

Thanks

like image 601
frankadelic Avatar asked Jun 30 '09 04:06

frankadelic


People also ask

What is JSON-RPC service?

JSON-RPC is used to communicate with an application that you running on your computer. It uses the HTTP protocol for remote procedure calls and JSON for data representation. It's a stateless, lightweight RPC protocol that's written in JavaScript.

Does RPC support JSON?

Based upon the JSON-RPC version used, the remote system will send various data outputs back to the source of request. All the JSON-RPC powered web transfers are unified and serialized with the help of JSON only.

Does JSON-RPC use XML?

JSON-RPC is a remote procedure call protocol encoded in JSON. It is similar to the XML-RPC protocol, defining only a few data types and commands.

What is JSON-RPC stackoverflow?

What exactly is JSON-RPC. It's a way for someone to send a request and receive a response. ( On the other side of the same coin, it's a way for someone to receive a request and send a response)


2 Answers

Can I easily build a JSON-RPC consumer in .NET?

Yes. JSON-RPC services are simple to consume as long as you have a robust JSON parser or formatter. Jayrock provides a simple client implementation JsonRpcClicnet that you can use to build a consumer. There is also a small demo sample included.

Are JSON-RPC web services self documenting and discoverable, like a SOAP WSDL?

No, there is nothing standardized but there are ideas being floated around like Service Mapping Description Proposal.

Can I easily add a Web Reference in Visual Studio to a JSON-RPC web service?

This can work if the server-side implementation provides a WSDL-based description of the JSON-RPC service but none are known to provide this to date.

like image 119
Atif Aziz Avatar answered Oct 23 '22 07:10

Atif Aziz


Check out Jayrock.

Jayrock is a modest and an open source (LGPL) implementation of JSON and JSON-RPC for the Microsoft .NET Framework, including ASP.NET. What can you do with Jayrock? In a few words, Jayrock allows clients, typically JavaScript in web pages, to be able to call into server-side methods using JSON as the wire format and JSON-RPC as the procedure invocation protocol. The methods can be called synchronously or asynchronously.

like image 1
James Newton-King Avatar answered Oct 23 '22 08:10

James Newton-King