Jayrock: web methods not exported

456 Views Asked by At

I'm trying to figure out what I'm doing wrong with a simple Jayrock JSON-RPC service.

Basically, I'm writing a JSON proxy for a .NET WCF web service so that iPhones can use it. The SOAP service insterface is working so I'm just implementing a service instance in my Jayrock handler and calling the corresponding methods.

Unfortunately, and although I had no issues with my test project, when I do that with the actual application, none of the Jayrock web methods that I marked as JsonRpcMethod are exported. All I see is the 3 default methods.

I disconnected all the other methods, in case there was some interference and I'm still not seeing anything. Any suggestion as to what I could be doing wrong ?

Here is my generic handler code:

using System;
using System.Web;
using Jayrock.Json;
using Jayrock.JsonRpc;
using Jayrock.JsonRpc.Web;
using WimotiDTO.DataContract;

namespace WimotiWS
{
    /// <summary>
    ///  Summary description for JSONEndpoint
    /// This class implement a JSon proxy for the Wimoti web service
    /// </summary>
    public class JSONEndpoint : JsonRpcHandler
    {
        [JsonRpcMethod("Test")]
        string Test()
        {
            return "Yeeha!";
        }
    }
}

And here is the page:

<%@ WebHandler Language="C#" CodeBehind="JSONEndpoint.ashx.cs" Class="WimotiWS.JSONEndpoint"%>

Finally, calling the method list method returns:

["system.listMethods","system.version","system.about"]
1

There are 1 best solutions below

0
On

The class attribute should be used:

[JsonRpcService("Handler")]
public class Handler : JsonRpcHandler, IRequiresSessionState