在.NET中使用JSON-RPC Web服务

时间:2022-08-08 19:33:59

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)

业务合作伙伴建议使用JSON-RPC而不是SOAP构建Web服务库。 (注意它们不是必须在.NET中构建,但我是)

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.

我过去曾将JSON用于基于客户端的Ajax调用,但此Web服务库主要用于服务器端调用和同步大量数据。

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

我对JSON-RPC没有多少经验。

Questions:

问题:

  • Can I easily build a JSON-RPC consumer in .NET?
  • 我可以在.NET中轻松构建JSON-RPC使用者吗?
  • Are JSON-RPC web services self documenting and discoverable, like a SOAP WSDL?
  • JSON-RPC Web服务是否像SOAP WSDL一样自我记录和发现?
  • Can I easily add a Web Reference in Visual Studio to a JSON-RPC web service?
  • 我可以轻松地将Visual Studio中的Web引用添加到JSON-RPC Web服务吗?

Thanks

谢谢

5 个解决方案

#1


4  

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

我可以在.NET中轻松构建JSON-RPC使用者吗?

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.

是。只要您拥有强大的JSON解析器或格式化程序,JSON-RPC服务就很容易使用。 Jayrock提供了一个简单的客户端实现JsonRpcClicnet,您可以使用它来构建使用者。还包括一个小的演示样本。

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

JSON-RPC Web服务是否像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?

我可以轻松地将Visual Studio中的Web引用添加到JSON-RPC Web服务吗?

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.

如果服务器端实现提供了基于WSDL的JSON-RPC服务描述,但是迄今为止都没有提供此服务,则这可以工作。

#2


1  

Check out Jayrock.

查看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.

Jayrock是用于Microsoft .NET Framework(包括ASP.NET)的JSON和JSON-RPC的适度和开源(LGPL)实现。你能用Jayrock做什么?简而言之,Jayrock允许客户端(通常是网页中的JavaScript)能够使用JSON作为有线格式调用服务器端方法,并使用JSON-RPC作为过程调用协议。可以同步或异步调用这些方法。

#3


0  

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

我可以在.NET中轻松构建JSON-RPC使用者吗?

Shouldn't be difficult as long as you know what you're doing.

只要你知道自己在做什么,就不会有困难。

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

JSON-RPC Web服务是否像SOAP WSDL一样自我记录和发现?

Discoverable yes, documenting in as much as you can get function names and parameter lists. (not entirely sure what you're asking for as far as documentation goes).

可发现是的,尽可能多地记录函数名称和参数列表。 (就文档而言,并不完全确定你要求的是什么)。

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

我可以轻松地将Visual Studio中的Web引用添加到JSON-RPC Web服务吗?

I don't think so, no. (Though, I have no idea, it's possible. My experience with JSON-RPC is in PHP/JS mostly)

我不这么认为,不。 (虽然,我不知道,这是可能的。我对JSON-RPC的体验主要是在PHP / JS中)

Relevant links:

相关链接:

#4


0  

Maybe you could have a look at json-wsp which is much like json-rpc but with a discription specification. It is implemented as an interface in Ladon for python. http://pypi.python.org/pypi/ladon

也许你可以看看json-wsp,这很像json-rpc,但有一个描述规范。它作为一个接口在Ladon for python中实现。 http://pypi.python.org/pypi/ladon

#5


0  

I have some sample Json-Rpc 2.0 clients for .net and windows phone 7 in the Json-RPC.NET sources.

我在Json-RPC.NET源代码中为.net和windows phone 7提供了一些示例Json-Rpc 2.0客户端。

Check them out: .Net Client and WP7 Client

检查出来:.Net Client和WP7 Client

#1


4  

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

我可以在.NET中轻松构建JSON-RPC使用者吗?

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.

是。只要您拥有强大的JSON解析器或格式化程序,JSON-RPC服务就很容易使用。 Jayrock提供了一个简单的客户端实现JsonRpcClicnet,您可以使用它来构建使用者。还包括一个小的演示样本。

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

JSON-RPC Web服务是否像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?

我可以轻松地将Visual Studio中的Web引用添加到JSON-RPC Web服务吗?

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.

如果服务器端实现提供了基于WSDL的JSON-RPC服务描述,但是迄今为止都没有提供此服务,则这可以工作。

#2


1  

Check out Jayrock.

查看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.

Jayrock是用于Microsoft .NET Framework(包括ASP.NET)的JSON和JSON-RPC的适度和开源(LGPL)实现。你能用Jayrock做什么?简而言之,Jayrock允许客户端(通常是网页中的JavaScript)能够使用JSON作为有线格式调用服务器端方法,并使用JSON-RPC作为过程调用协议。可以同步或异步调用这些方法。

#3


0  

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

我可以在.NET中轻松构建JSON-RPC使用者吗?

Shouldn't be difficult as long as you know what you're doing.

只要你知道自己在做什么,就不会有困难。

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

JSON-RPC Web服务是否像SOAP WSDL一样自我记录和发现?

Discoverable yes, documenting in as much as you can get function names and parameter lists. (not entirely sure what you're asking for as far as documentation goes).

可发现是的,尽可能多地记录函数名称和参数列表。 (就文档而言,并不完全确定你要求的是什么)。

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

我可以轻松地将Visual Studio中的Web引用添加到JSON-RPC Web服务吗?

I don't think so, no. (Though, I have no idea, it's possible. My experience with JSON-RPC is in PHP/JS mostly)

我不这么认为,不。 (虽然,我不知道,这是可能的。我对JSON-RPC的体验主要是在PHP / JS中)

Relevant links:

相关链接:

#4


0  

Maybe you could have a look at json-wsp which is much like json-rpc but with a discription specification. It is implemented as an interface in Ladon for python. http://pypi.python.org/pypi/ladon

也许你可以看看json-wsp,这很像json-rpc,但有一个描述规范。它作为一个接口在Ladon for python中实现。 http://pypi.python.org/pypi/ladon

#5


0  

I have some sample Json-Rpc 2.0 clients for .net and windows phone 7 in the Json-RPC.NET sources.

我在Json-RPC.NET源代码中为.net和windows phone 7提供了一些示例Json-Rpc 2.0客户端。

Check them out: .Net Client and WP7 Client

检查出来:.Net Client和WP7 Client