murugamsm / xmlrpcnet

Automatically exported from code.google.com/p/xmlrpcnet
0 stars 0 forks source link

Inhertance of an interface metod does not expose "XmlRpcBegin" and "XmlRpc" attributes #49

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This is a connection to Drupals XmlRpc service.

What steps will reproduce the problem?
1. Basic Code: 
    public interface IDrupalXmlRpc
    {
        [XmlRpcBegin("system.connect")]
        IAsyncResult BeginConnect(AsyncCallback acb);

        [XmlRpcEnd]
        Drupal EndConnect(IAsyncResult asr);
    }

    public class BaseClass<T> where T : IXmlRpcProxy
    {
        public T Service { get; set; }

        public void IntilializeService()
        {
            Service = XmlRpcProxyGen.Create<T>();
        }
    }

    [XmlRpcUrl("http://www.mysite.com/?q=services/xmlrpc")]
    public interface IMolineDrupalService : IXmlRpcProxy, IDrupalXmlRpc
    {
    }

    public class DevMoline : BaseClass<IMolineDrupalService>
    { ...}

;Button Event
        private void btnGo_Click(object sender, EventArgs e)
        {
            try
            {
                dev = new DevMoline();
                dev.IntilializeService();

                 AsyncCallback acb = new AsyncCallback(ConnectionCallBack);
                 dev.Service.BeginConnect(acb);

            }
            catch (Exception)
            {

                throw;
            }
        }

2. What is the expected output? What do you see instead?
When the "dev.Service.BeginConnect(acb)" method is called, you receive the
following error: 
Shouldn't the IAsyncResult method of "BeginConnect" inherit as well as
"EndConnect"?

Error: Method 'BeginConnect' in type
'XmlRpcProxy4b5de82f-45cb-4ce6-80e0-1f67a6f69684' from assembly
'XmlRpcProxy4b5de82f-45cb-4ce6-80e0-1f67a6f69684, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null' does not have an implementation.

For this to work, I need to add "new  IAsyncResult BeginConnect..." to the
IMolineDrupalService interface.

Original issue reported on code.google.com by Aaron.Mo...@gmail.com on 28 Feb 2009 at 4:51

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I experience an exception where my Async methods fail on 
XmlRpcProxyGen.Create<T>() 
with: 

System.TypeLoadException: Method 'BeginPermission' in type 
'XmlRpcProxyad9af8e5-f79f-
47a8-bc42-ffc34b39f9e3' from assembly 'XmlRpcProxyad9af8e5-f79f-47a8-bc42-
ffc34b39f9e3, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' does not 
have an 
implementation.

I believe the [XmlRpcBegin] and [XmlRpcEnd] attributes are not surviving the 
inheritance of my interfaces, resulting in missing proxy stubs.

I have split the service interface from the proxy interface, to allow 
composition and 
reusability of the service interface, as follows:

interface ISomeService 
{
   [XmlRpcMethod]
   void DoSomething();
   [XmlRpcBegin]
   void BeginDoSomething(AsyncCallback acb, object asyncState);
   [XmlRpcEnd]
   void EndDoSomething(IAsyncResult iar);
}

interface SomeServiceProxy : ISomeService, IXmlRpcProxy
{
  // Empty
}

Original comment by jcaradoc...@gmail.com on 4 Aug 2009 at 11:10

GoogleCodeExporter commented 8 years ago
Hi jcaradocdavies, 

I think your issue is that your interface is not public. 

Regards,

Aaron

Original comment by Aaron.Mo...@gmail.com on 25 Sep 2009 at 5:44

GoogleCodeExporter commented 8 years ago

Original comment by ChasC...@gmail.com on 6 Mar 2011 at 10:12