Astn/JSON-RPC.NET

Question: Method not found

Closed this issue · 7 comments

Hi,

I used the example code to try and get my own service up and running.

I am passing {"method": "helloworld", "params": ["lovely"], "id": 10}
The result however is:
{"jsonrpc":"2.0","error":{"code":-32601,"message":"Method not found","data":"The method does not exist / is not available."},"id":10}

Could anyone help me and tell me what I am doing wrong?

Much appreciated,

Dave

----code below----
MyCode.txt

Added
Sub Main()
Dim _svc = New ExampleCalculatorService()

Astn commented

Glad you got it working!

Astn commented

Do you have it working over sockets? There are a few examples on the wiki.
For the http hosting, what framework are you using for http?
There is an asp.net adapter I created a few years ago, you could likely adapt the code from it for the framework you are using. https://github.com/Astn/JSON-RPC.NET/tree/master/AustinHarris.JsonRpc.AspNet
Or if that's the framework you are using, then you can use it.

Astn commented

Does it only work with Mono or also with Kestrel?

The nuget package only works with mono on linux, but that's mostly just because the project / nuget changes to get it to work on dotnet core have not been merged in.
If you want it to work on dotnet core today, then you will need to clone the repo, and go through the process of fixing some of the imports as some of them are different, but that was the only change .
I do have a branch where I did that work, and also started down the path of a total refactor. Shooting for more speed and pluggable json serializers. #90 There are more things I want to do on that branch so just use it as a reference if that is the path you want to take. The dotnet core support was added in the first commit of that branch feb8399

I was in the understanding that the sockets and http could coexist in the same environment.

I think you could do this. You just need to make sure your continuations or callbacks are sending messages to the correct tcp/http channel, but you need to do that with Sockets or HTTP anyway... So I'm not thinking about any issues.