You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Pavel Tupitsyn (Jira)" <ji...@apache.org> on 2022/10/03 06:50:00 UTC

[jira] [Updated] (IGNITE-17796) .NET: Services do not work with default interface implementations

     [ https://issues.apache.org/jira/browse/IGNITE-17796?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Tupitsyn updated IGNITE-17796:
------------------------------------
    Description: 
The code below throws *"InvalidOperationException: Failed to invoke proxy: there is no method 'Greet' in type 'MyService' with 1 arguments"*

{code}
using Apache.Ignite.Core;
using Apache.Ignite.Core.Services;

using var ignite = Ignition.Start();

ignite.GetServices().DeployClusterSingleton("svc", new MyService());
var svc = ignite.GetServices().GetServiceProxy<IMySvc>("svc");
Console.WriteLine(svc.Greet("foo"));

public interface IMySvc
{
    string Greet(object arg) => $"Hello, {arg}!";
}

class MyService : IService, IMySvc
{
    public void Init(IServiceContext context) { }
    public void Execute(IServiceContext context) { }
    public void Cancel(IServiceContext context) { }
}
{code}

  was:
{code}
using Apache.Ignite.Core;
using Apache.Ignite.Core.Services;

using var ignite = Ignition.Start();

ignite.GetServices().DeployClusterSingleton("svc", new MyService());
var svc = ignite.GetServices().GetServiceProxy<IMySvc>("svc");
Console.WriteLine(svc.Greet("foo"));

public interface IMySvc
{
    string Greet(object arg) => $"Hello, {arg}!";
}

class MyService : IService, IMySvc
{
    public void Init(IServiceContext context) { }
    public void Execute(IServiceContext context) { }
    public void Cancel(IServiceContext context) { }
}
{code}


> .NET: Services do not work with default interface implementations
> -----------------------------------------------------------------
>
>                 Key: IGNITE-17796
>                 URL: https://issues.apache.org/jira/browse/IGNITE-17796
>             Project: Ignite
>          Issue Type: Bug
>          Components: platforms
>    Affects Versions: 2.13
>            Reporter: Pavel Tupitsyn
>            Assignee: Pavel Tupitsyn
>            Priority: Major
>              Labels: .NET
>             Fix For: 2.15
>
>
> The code below throws *"InvalidOperationException: Failed to invoke proxy: there is no method 'Greet' in type 'MyService' with 1 arguments"*
> {code}
> using Apache.Ignite.Core;
> using Apache.Ignite.Core.Services;
> using var ignite = Ignition.Start();
> ignite.GetServices().DeployClusterSingleton("svc", new MyService());
> var svc = ignite.GetServices().GetServiceProxy<IMySvc>("svc");
> Console.WriteLine(svc.Greet("foo"));
> public interface IMySvc
> {
>     string Greet(object arg) => $"Hello, {arg}!";
> }
> class MyService : IService, IMySvc
> {
>     public void Init(IServiceContext context) { }
>     public void Execute(IServiceContext context) { }
>     public void Cancel(IServiceContext context) { }
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)