Problem converting types of Webservices

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sfreak
    New Member
    • Mar 2010
    • 64

    Problem converting types of Webservices

    Hello guys,

    Im developing an architecture which uses c# Winforms, Webservices and Remoting. Im stuck in a issue about Types and namespaces. Ill try to explain the scenario to you to help me if you can...

    its a MVC template and i have my View using Winforms technology. My Control is encapsulated in a Webservice as an Application server. My Model is represented by a Windows Service using Remoting as the communication protocol (Socket TCP)

    To me to instantiate my Remoting service i need to instantiate an Interface that represent my object. As the following code:

    Code:
    IMyInterface MyInterface = (IMyInterface)Activator.GetObject(typeof(IMyInterface), "tcp://localhost:6060/MyRemoteObject");
    Where
    IMyInterface = Interface that contains the methods id like to use which is a DLL.
    MyInterface = the object created to call my remote methods for example:
    Code:
    int Sum = MyInterface.ReturnSum(10,10);
    MyRemoteObject = the alias of the object that will be instantiate on my Remoting server.

    Well ... that´s a little piece of my scenario.

    The issue im facing is:

    I reference a webservice to get the type of return on the Interface to use in a method and i have this Webservice referenced on my Remoting server that implements this interface.
    As the following:

    Interface side
    Code:
    MyWebservice.MyClass ReturnMyClass();
    Remoting server side which implements IMyInterface
    Code:
        public MyWebservice.MyClass ReturnMyClass()
        {
             MyReferencedWebservice.MyWebservice WS1 = new MyReferencedWebservice.MyWebservice();
             return WS1.ReturnMyClass();
        }
    and then i have 2 different assemblies from the same place referenced in different ways.

    Do you have any suggestion for this issue?
Working...