WCF vs Remoting vs WebServices (2.0)

Posts   
 
    
Angus
User
Posts: 44
Joined: 08-Jul-2005
# Posted on: 28-Feb-2008 15:42:41   

Hello All. I have a question about which is the best (Fastest) way to send entities across the wire.

We are building a tablet application that will store some of it's data in a SQLCe Desktop database and get some other "Server Only" data from our hosted database over the internet.

We will be putting a web server in the DMZ that will host the 'Web Service' / 'WCF' / Remoting end points and this will talk to the db behind the firewall.

I have read in other posts that Franz had recommended remoting using fast serialization. Is this possible in my situation?
If yes is would that be better than web services?

If we chose WCF we will probable host them inside IIS as a web service. Does this make sense to do?

I have seen the samples (WCF, Remoting) that have been released, but I don't want to spend too much time playing with an example if it will not work when deployed in the above situation.

Thanks for the help

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 29-Feb-2008 10:16:26   

As you are asking about the fastest, then I think the answer is Remoting. Also it allows you to pass predicates and unitofwork objects over the wire.

On the other hand it seems that the future is for WCF simple_smile and Remoting seems obsolete now.

Some people also claim that using Binary encoding with WCF is faster than remoting. Please check the following links: http://geekswithblogs.net/danielcarbajal/archive/2006/07/05/84160.aspx

http://jeffbarnes.net/portal/blogs/jeff_barnes/archive/2007/02/22/wcf-enable-binary-encoding-over-http.aspx

(EDIT) If you want to try out binary encoding over HTTP, check out the attached files and use them with our WCF over IIS example.

Attachments
Filename File size Added on Approval
Binary Encoding.zip 1,386 29-Feb-2008 11:01.00 Approved
Angus
User
Posts: 44
Joined: 08-Jul-2005
# Posted on: 29-Feb-2008 23:45:03   

Walaa wrote:

As you are asking about the fastest, then I think the answer is Remoting. Also it allows you to pass predicates and unitofwork objects over the wire.

On the other hand it seems that the future is for WCF simple_smile and Remoting seems obsolete now.

Some people also claim that using Binary encoding with WCF is faster than remoting. Please check the following links: http://geekswithblogs.net/danielcarbajal/archive/2006/07/05/84160.aspx

http://jeffbarnes.net/portal/blogs/jeff_barnes/archive/2007/02/22/wcf-enable-binary-encoding-over-http.aspx

(EDIT) If you wantg to try out binary encoding over HTTP, check out the attached files and use them with our WCF over IIS example.

Walla,

Thanks for the info. I think I will start off using the remoting as that will allow me to pass around unitofwork. I also found out that we may not be able to force .NET 3.0 on the client ant would therefore exclude WCF for now.

I will try out your examples to see if Binary encoding over HTTP with WCF is faster. If so I may be able to make the push for 3.0.

Chris

stefcl
User
Posts: 210
Joined: 23-Jun-2007
# Posted on: 01-Mar-2008 09:23:06   

Hello Angus,

I will try out your examples to see if Binary encoding over HTTP with WCF is faster. If so I may be able to make the push for 3.0.

I'm sorry that I don't answer your last question. I think a lot of people among us would be interested in the results of your testing. Would you mind sharing them?

Angus
User
Posts: 44
Joined: 08-Jul-2005
# Posted on: 06-Mar-2008 21:44:00   

Walla,

Thanks for the help. Some new info... For the time WCF is out as we are constrained to .NET 2.0.

In trying to set up the Remoting example I have a few questions / comments. First I have the remoting working in the example and it looks ok.
I want to host the services in IIS though and am wondering how that would look.
Speciffically, do I need to register on the clients app.config file every single class that gets remoted? If so, I don't really like that approach.
I noticed that in the sample there is no registering of classes in the config file as it is using an interface. I like this approach and was wondering if this would work the same if the host was not a console app but under IIS?

I am also using the Manager Templates and I really like the "Generated" functionality they provide out of the box. I would like to create an interface for each of the manager classes that gets generated and reference this from both the remoting host and client. Then when I re-gen and redeploy the remoting host, all i have to do is refresh the interface on the client and all is good. smile But from what I am reading all the examples in IIS look as though I have to register every class on both the server and client when using IIS.

If this is possible I would have an Interface for each Manger Class. Then I think my ClientSide Manager classes would do something like this...

CustomerManager pseudo code


        private static ICustomerDataService m_service;
        private static ICustomerDataService MyService
        {
            get
            {
                if (m_service == null)
                {
                    HttpClientChannel channel = new HttpClientChannel();
                    ChannelServices.RegisterChannel(channel, true);

                    MarshalByRefObject o = (MarshalByRefObject)RemotingServices.Connect(typeof(ICustomerDataService), string.Format("tcp://{0}:65100/CustomerManagerEndPoint", SERVERNAME));
                    m_service = o as ICustomerDataService;
                    if (m_service == null)
                    {
                        throw new Exception("Service couldn't be obtained. Aborting");
                    }
                }
                return m_service;
            }
        }
        public static EntityCollection<Northwind.DAL.EntityClasses.CustomerEntity> GetAllCustomers()
        {
            return MyService.GetAllCustomers();
        }

ProductManager pseudo code


        private static IProductDataService m_service;
        private static IProductDataService MyService
        {
            get
            {
                if (m_service == null)
                {
                    HttpClientChannel channel = new HttpClientChannel();
                    ChannelServices.RegisterChannel(channel, true);

                    MarshalByRefObject o = (MarshalByRefObject)RemotingServices.Connect(typeof(IProductDataService), string.Format("tcp://{0}:65100/ProductManagerEndPoint", SERVERNAME));
                    m_service = o as IProductDataService;
                    if (m_service == null)
                    {
                        throw new Exception("Service couldn't be obtained. Aborting");
                    }
                }
                return m_service;
            }
        } 

        public static EntityCollection<Northwind.DAL.EntityClasses.ProductEntity> GetAllProducts()
        {
            return MyService.GetAllProducts();
        }

Then all I have to do is register the ManagerClasses on the server as endpoints????

IS this correct or am I missing something?

I would really like to implement the simplicity of the remoting example just using IIS as the host and I hope this is possible.

Thanks for any thoughts you can provide.