Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. .NET Remoting vs. Web Services

.NET Remoting vs. Web Services

Scheduled Pinned Locked Moved The Lounge
helpquestioncsharpvisual-studiowcf
19 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Lost User

    It really depends what you're trying to achieve. Both technologies have pros and cons. Can you explain a little more? Here are some links you should like: http://dotnetjunkies.com/WebLog/chris.taylor/archive/2004/01/31/6385.aspx[^] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/bdadotnetarch14.asp[^] http://www.codinghorror.com/blog/archives/000049.html[^] http://www.codeguru.com/columns/VB/article.php/c8899/[^] http://www.thinktecture.com/Resources/Articles/REMOTINGVS.ASP.NETWEBSERV.html[^] Carl Mercier Geek entrepreneurs, visit my blog! [^]

    L Offline
    L Offline
    Luis Alonso Ramos
    wrote on last edited by
    #5

    Basically I want to have my smart client application try to process all information on the client, loading and saving it from the server. For example, my idea is to have a Customer class (business layer) with some properties (name for example). So, when the user searches for customers, I call a remote method with the search criteria and it returns an array of customer IDs and names. Once the user selects a customer, the app calls another method and gets the Customer object for that customer. Every now and then (say, every 30 minutes) a background thread will download all the customers for that office, so that if the connection is ever dropped, customers can still sign in (it's a gym, and customers must sign in when entering -- that's basically the offline functionality required). All this customer information will be stored in an XML file so it's available next time the program starts. The app has not yet been designed in its entirely, but the idea is to have the client and the server as separated as possible (I don't want to write 500 remote methods if 200 will do -- and data transfer time will be slow). All the reports will be generated by a web application, so the smart client will only contain the UI for day-to-day operations (customer sign in, new customer, payments, and so on.) One thing I don't really like about web services is that if I return from the web method my business object (a Customer object) on the client I get a pseudo-Customer class that only contains fields (not properties or methods.) I looked into custom serialization, but I didn't find it possible for web services. That's one of the things that made me actually consider remoting. -- LuisR


    Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

    The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005

    L 1 Reply Last reply
    0
    • L Luis Alonso Ramos

      Basically I want to have my smart client application try to process all information on the client, loading and saving it from the server. For example, my idea is to have a Customer class (business layer) with some properties (name for example). So, when the user searches for customers, I call a remote method with the search criteria and it returns an array of customer IDs and names. Once the user selects a customer, the app calls another method and gets the Customer object for that customer. Every now and then (say, every 30 minutes) a background thread will download all the customers for that office, so that if the connection is ever dropped, customers can still sign in (it's a gym, and customers must sign in when entering -- that's basically the offline functionality required). All this customer information will be stored in an XML file so it's available next time the program starts. The app has not yet been designed in its entirely, but the idea is to have the client and the server as separated as possible (I don't want to write 500 remote methods if 200 will do -- and data transfer time will be slow). All the reports will be generated by a web application, so the smart client will only contain the UI for day-to-day operations (customer sign in, new customer, payments, and so on.) One thing I don't really like about web services is that if I return from the web method my business object (a Customer object) on the client I get a pseudo-Customer class that only contains fields (not properties or methods.) I looked into custom serialization, but I didn't find it possible for web services. That's one of the things that made me actually consider remoting. -- LuisR


      Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

      The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #6

      It seems that Remoting is right for the job in your case. I suggest you take a look at Rocky Lhotka[^]'s Expert Business Object book... it will help you use Remoting properly and design your application to make the most out of it. Shameless plug: my copy of the book is for sale :) Carl Mercier Geek entrepreneurs, visit my blog! [^]

      L 1 Reply Last reply
      0
      • R Rob Graham

        Luis Alonso Ramos wrote:

        But I've been learning lately about .NET remoting and it seems I could use it as well. And it's even better that I can use it with IIS and HTTP.

        Web services also work with HTTP and IIS. straight remoting may be more problematic in terms of firewall issues (unless you stick to HTTP) since you will have to open a tcp port for it. Web services in .Net 2.0 are "wire compatible" with remoting (indigo) but force you to define a clear messaging protocal (web services are "technology neutral" in that the only requirement is that the client and server respect the predefined SOAP message definitions as specified in the wsdl and xsd files theat describe the service. IMO web services are more the flexible alternative (more cross platform capable). Absolute faith corrupts as absolutely as absolute power Eric Hoffer All that is necessary for the triumph of evil is that good men do nothing. Edmund Burke

        L Offline
        L Offline
        Luis Alonso Ramos
        wrote on last edited by
        #7

        [Copy/Paste from my post[^] above] "One thing I don't really like about web services is that if I return from the web method my business object (a Customer object) on the client I get a pseudo-Customer class that only contains fields (not properties or methods.) I looked into custom serialization, but I didn't find it possible for web services. That's one of the things that made me actually consider remoting." In a previous application I developed with web services, to overcome this problem I had to create a wrapper class that would call the web service, and then fill a real business object and return it to the caller. With some 25 methods it was 2000 lines of code that I had to be mantaining if I added another property to any of the classes. I really would like to avoid it, since this new application will be many times bigger. -- LuisR


        Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

        The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005

        R 1 Reply Last reply
        0
        • R Ryan Roberts

          Remoting looks like it may be a good option, if you make sure you don't use it in a tightly coupled, 'chatty' way. Binary remoting is significantly faster than using an XML webservice, though you still need to be aware of the performance implications of serialising large ammounts of data. A good place to start looking might be Rocky Lhokta's CSLA framework[^]. This uses a 'dataportal' - a single request / response mechanism for fetching and updating business objects which can be configured to use remoting if required. http://msdn.microsoft.com/library/en-us/dnadvnet/html/vbnet03262002.asp?frame=true[^] Ryan

          O fools, awake! The rites you sacred hold Are but a cheat contrived by men of old, Who lusted after wealth and gained their lust And died in baseness—and their law is dust. al-Ma'arri (973-1057)

          L Offline
          L Offline
          Luis Alonso Ramos
          wrote on last edited by
          #8

          Thanks, I'll take a look! :) -- LuisR


          Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

          The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005

          1 Reply Last reply
          0
          • L Luis Alonso Ramos

            Hello, I hope this is not considered a programming question, since it's more on the technology itself than on how to do something specific. I'm designing a smart client application that will be used in several locations (around 100) around the world. It will be using a leased Windows 2003 server. One of the requirements is that it must have limited functionality when working offline (either by choice or because there is no connectivity.) Also, it must work with all firewalls (since I will not be going to Argentina to fix a firewall-related problem). At first I thought about using web services. They work with HTTP (and SSL) and once I have some data locally, I can work offline perfectly. But I've been learning lately about .NET remoting and it seems I could use it as well. And it's even better that I can use it with IIS and HTTP. Does anyone have any experience with something similar? what do you think? Thanks in advance, -- LuisR


            Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

            The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005

            T Offline
            T Offline
            Tad McClellan
            wrote on last edited by
            #9

            You might want to look at MSMQ as well. E=mc2 -> BOOM

            1 Reply Last reply
            0
            • L Luis Alonso Ramos

              [Copy/Paste from my post[^] above] "One thing I don't really like about web services is that if I return from the web method my business object (a Customer object) on the client I get a pseudo-Customer class that only contains fields (not properties or methods.) I looked into custom serialization, but I didn't find it possible for web services. That's one of the things that made me actually consider remoting." In a previous application I developed with web services, to overcome this problem I had to create a wrapper class that would call the web service, and then fill a real business object and return it to the caller. With some 25 methods it was 2000 lines of code that I had to be mantaining if I added another property to any of the classes. I really would like to avoid it, since this new application will be many times bigger. -- LuisR


              Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

              The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005

              R Offline
              R Offline
              Rob Graham
              wrote on last edited by
              #10

              If you add new properties or methods, you are "breaking" the message contract. Web services would force you to properly version the change, so that "old" clients could still do business with the service, while new clients could take advantage of the new features. Remoting will exhibt just as strict a requirement, if you add to the public interface of the business object, old clients won't recognize any of it (unless maybe, you cheat, and keep the strong name key and version info the same). If you don't keep your client's understanding of the business object the same as your server's, how do you expect to reliably debug issues? Sometimes there is no avoiding maintenance. Absolute faith corrupts as absolutely as absolute power Eric Hoffer All that is necessary for the triumph of evil is that good men do nothing. Edmund Burke

              L 1 Reply Last reply
              0
              • R Rob Graham

                If you add new properties or methods, you are "breaking" the message contract. Web services would force you to properly version the change, so that "old" clients could still do business with the service, while new clients could take advantage of the new features. Remoting will exhibt just as strict a requirement, if you add to the public interface of the business object, old clients won't recognize any of it (unless maybe, you cheat, and keep the strong name key and version info the same). If you don't keep your client's understanding of the business object the same as your server's, how do you expect to reliably debug issues? Sometimes there is no avoiding maintenance. Absolute faith corrupts as absolutely as absolute power Eric Hoffer All that is necessary for the triumph of evil is that good men do nothing. Edmund Burke

                L Offline
                L Offline
                Luis Alonso Ramos
                wrote on last edited by
                #11

                Rob Graham wrote:

                If you add new properties or methods, you are "breaking" the message contract.

                This was when the app was under development, not after it was released. I make my little Customer class, and its related web methods. Then I add another field to the Customer class and I have to go modify all the web method calls. That's the maintenance I want to avoid. But first of all, I want to avoid writing those wrapper classes. -- LuisR


                Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

                The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005

                R 1 Reply Last reply
                0
                • L Luis Alonso Ramos

                  Rob Graham wrote:

                  If you add new properties or methods, you are "breaking" the message contract.

                  This was when the app was under development, not after it was released. I make my little Customer class, and its related web methods. Then I add another field to the Customer class and I have to go modify all the web method calls. That's the maintenance I want to avoid. But first of all, I want to avoid writing those wrapper classes. -- LuisR


                  Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

                  The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005

                  R Offline
                  R Offline
                  Rob Graham
                  wrote on last edited by
                  #12

                  I think you have a design issue. What passes between the client and server in the web method should be a simple (data only) object, whose content (public fields) both sides understand (as represented by the XSD definition of the object). Putthe methods in a separate dll that contains or uses a message class instance created by deserializing the message. The message class definitions (and any shared constants,etc. should be in its own dll, which both client and server use to itantiate instances... Your webmethod should just have an instance of the message object as its message data parameter, you shouldn't have to change any webmethod if you change the internals of the message. Absolute faith corrupts as absolutely as absolute power Eric Hoffer All that is necessary for the triumph of evil is that good men do nothing. Edmund Burke

                  L 1 Reply Last reply
                  0
                  • L Lost User

                    It seems that Remoting is right for the job in your case. I suggest you take a look at Rocky Lhotka[^]'s Expert Business Object book... it will help you use Remoting properly and design your application to make the most out of it. Shameless plug: my copy of the book is for sale :) Carl Mercier Geek entrepreneurs, visit my blog! [^]

                    L Offline
                    L Offline
                    Luis Alonso Ramos
                    wrote on last edited by
                    #13

                    Carl Mercier wrote:

                    Rocky Lhotka[^]'s Expert Business Object

                    I'm looking into it already... interesting framework altough it seems a little bit too complex for this particular application. Is it suitable for small apps? -- LuisR


                    Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

                    The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005

                    L 1 Reply Last reply
                    0
                    • R Rob Graham

                      I think you have a design issue. What passes between the client and server in the web method should be a simple (data only) object, whose content (public fields) both sides understand (as represented by the XSD definition of the object). Putthe methods in a separate dll that contains or uses a message class instance created by deserializing the message. The message class definitions (and any shared constants,etc. should be in its own dll, which both client and server use to itantiate instances... Your webmethod should just have an instance of the message object as its message data parameter, you shouldn't have to change any webmethod if you change the internals of the message. Absolute faith corrupts as absolutely as absolute power Eric Hoffer All that is necessary for the triumph of evil is that good men do nothing. Edmund Burke

                      L Offline
                      L Offline
                      Luis Alonso Ramos
                      wrote on last edited by
                      #14

                      So that means I should convert my Customer business object to something like a pseudo-Customer that only has fields for Name, LastName and so on, send that through the webmethod, and convert it back to a real Customer in the client? It's that conversion from Customer to pseudo-Customer and back that I want to avoid. That more or less what I did in my other application, except that the conversion from a business object to the pseudo-business object (the message object) was done automatically, but I had to make it back to a real business object on the client side (an ArrayList is serialized as an array automatically, but I had to make it back into an ArrayList on the client). I was thinking that all my business objects could contain two methods: a static FromMessageObject that would construct an object from that message object, and a ToMessageObject that would return a message object from the actual object. But then, one question. When I add the webservice reference in VS, how can I make it generate methods that return my message objects (in my own DLL) instead of generating stub classes? (This might actually be considered a programming question! :rolleyes:) -- LuisR


                      Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

                      The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005

                      R 1 Reply Last reply
                      0
                      • L Luis Alonso Ramos

                        Carl Mercier wrote:

                        Rocky Lhotka[^]'s Expert Business Object

                        I'm looking into it already... interesting framework altough it seems a little bit too complex for this particular application. Is it suitable for small apps? -- LuisR


                        Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

                        The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005

                        L Offline
                        L Offline
                        Lost User
                        wrote on last edited by
                        #15

                        I found it a little complex also, that's why we rolled our own. However, we don't use Remoting for that particular application I'm talking about. I think things can go fairly well, even for small apps, if you use code generators (CodeSmith for example). There's a bunch of CSLA templates available online. Carl Mercier Geek entrepreneurs, visit my blog! [^]

                        1 Reply Last reply
                        0
                        • L Luis Alonso Ramos

                          So that means I should convert my Customer business object to something like a pseudo-Customer that only has fields for Name, LastName and so on, send that through the webmethod, and convert it back to a real Customer in the client? It's that conversion from Customer to pseudo-Customer and back that I want to avoid. That more or less what I did in my other application, except that the conversion from a business object to the pseudo-business object (the message object) was done automatically, but I had to make it back to a real business object on the client side (an ArrayList is serialized as an array automatically, but I had to make it back into an ArrayList on the client). I was thinking that all my business objects could contain two methods: a static FromMessageObject that would construct an object from that message object, and a ToMessageObject that would return a message object from the actual object. But then, one question. When I add the webservice reference in VS, how can I make it generate methods that return my message objects (in my own DLL) instead of generating stub classes? (This might actually be considered a programming question! :rolleyes:) -- LuisR


                          Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

                          The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005

                          R Offline
                          R Offline
                          Rob Graham
                          wrote on last edited by
                          #16

                          Edit what it creates, and change the webmethods to suit yourself? (I haven't tried hosting the service in IIS, so I had to write the webmethods myself) this[^] artilce and this one[^] have some good starting points and examples. Absolute faith corrupts as absolutely as absolute power Eric Hoffer All that is necessary for the triumph of evil is that good men do nothing. Edmund Burke

                          L 1 Reply Last reply
                          0
                          • R Rob Graham

                            Edit what it creates, and change the webmethods to suit yourself? (I haven't tried hosting the service in IIS, so I had to write the webmethods myself) this[^] artilce and this one[^] have some good starting points and examples. Absolute faith corrupts as absolutely as absolute power Eric Hoffer All that is necessary for the triumph of evil is that good men do nothing. Edmund Burke

                            L Offline
                            L Offline
                            Luis Alonso Ramos
                            wrote on last edited by
                            #17

                            Thanks, I'll look into them! -- LuisR


                            Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

                            The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005

                            1 Reply Last reply
                            0
                            • L Luis Alonso Ramos

                              Hello, I hope this is not considered a programming question, since it's more on the technology itself than on how to do something specific. I'm designing a smart client application that will be used in several locations (around 100) around the world. It will be using a leased Windows 2003 server. One of the requirements is that it must have limited functionality when working offline (either by choice or because there is no connectivity.) Also, it must work with all firewalls (since I will not be going to Argentina to fix a firewall-related problem). At first I thought about using web services. They work with HTTP (and SSL) and once I have some data locally, I can work offline perfectly. But I've been learning lately about .NET remoting and it seems I could use it as well. And it's even better that I can use it with IIS and HTTP. Does anyone have any experience with something similar? what do you think? Thanks in advance, -- LuisR


                              Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

                              The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005

                              I Offline
                              I Offline
                              inphone
                              wrote on last edited by
                              #18

                              I see you are from Mexico, here is an article on spanish about this issue: http://metodos.lnds.net/2005/10/web\_services\_u\_object\_remoting.html

                              L 1 Reply Last reply
                              0
                              • I inphone

                                I see you are from Mexico, here is an article on spanish about this issue: http://metodos.lnds.net/2005/10/web\_services\_u\_object\_remoting.html

                                L Offline
                                L Offline
                                Luis Alonso Ramos
                                wrote on last edited by
                                #19

                                Muchas gracias!! Interesante lectura! :) For all of you who don't speak Spanish: "thank you very much, interesting read". -- LuisR


                                Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

                                The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005

                                1 Reply Last reply
                                0
                                Reply
                                • Reply as topic
                                Log in to reply
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes


                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • World
                                • Users
                                • Groups