title: MessagePack RPC C# - Server side
body: <p>I have a problem when trying to consume a server implementation of <code>MessagePack RPC</code>. I wrote one implementation for client and one for server based on a Python code provided by my company's client. </p>
  
  <p>The server implementation should be consumed by Python, but as far as I see that won't be a problem.</p>
  
  <p><strong>Server implementation:</strong></p>
  
  <pre><code>public class Program
  {
  
      static void Main(string[] args)
      {
          try
          {
              DefaultServiceTypeLocator def = new DefaultServiceTypeLocator();
              ServiceTypeLocator ser = def;
  
              def.AddService(new Methods().GetType());
              var services = ser.FindServices();
  
              var configuration = new RpcServerConfiguration();
  
              IPAddress ipAddress = GetIp();
              configuration.BindingEndPoint = new IPEndPoint(ipAddress, 8089);
              Console.WriteLine(new IPEndPoint(ipAddress, 8089).ToString());
              using (var server = new RpcServer(configuration))
              {
                  server.Start();
  
                  Console.ReadKey();
              }
          }
          catch (Exception ex)
          {
  
              Console.Write(ex);
              Console.ReadKey();
          }
  }
  [MessagePackRpcServiceContractAttribute]
  public class Methods
  {
      [MessagePackRpcMethodAttribute]
      public int hello0()
      {
          Console.WriteLine("hello0");
          return 0;
      }
  }
  </code></pre>
  
  <p><strong>Client implementation:</strong></p>
  
  <pre><code>public class Program
  {
      static void Main(string[] args)
      {
          try
          {
              var configuration = new RpcClientConfiguration();
              IPAddress ipAddress = GetIp();
  
              using (dynamic proxy = new DynamicRpcProxy(new IPEndPoint(ipAddress, 8089), configuration))
              {
                  dynamic res = proxy.hello0();
              }
          }
          catch (Exception ex)
          {
              Console.WriteLine(ex);
              Console.ReadKey();
          }
      }
  
      private static IPAddress GetIp()
      {
          string myHost = System.Net.Dns.GetHostName();
          IPAddress myIP = null;
  
          for (int i = 0; i &lt;= System.Net.Dns.GetHostEntry(myHost).AddressList.Length - 1; i++)
          {
              if (System.Net.Dns.GetHostEntry(myHost).AddressList[i].IsIPv6LinkLocal == false)
              {
                  if (System.Net.Dns.GetHostEntry(myHost).AddressList[i].AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
                      myIP = System.Net.Dns.GetHostEntry(myHost).AddressList[i];
              }
          }
          return myIP;
      }
  
  }
  </code></pre>
  
  <p>My client can't connect to my server, it can't see the methods over there. The error is: "operation does not exist".</p>
  
  <p>Anyone has any clue?</p>
  
  <p>Thank you!!</p>