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. General Programming
  3. C#
  4. split a web service

split a web service

Scheduled Pinned Locked Moved C#
c++csharpsysadminquestionlearning
7 Posts 3 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.
  • K Offline
    K Offline
    krism42
    wrote on last edited by
    #1

    We have a web service that is growing large enough that we wish to seperate logic. Ideally, we would have multiple code files on the server, and the service itself would still appear to be the same to consumers of it. If we were doing it in c++, we would simply split the implementation of our WebService class across several .cpp. Of course, we can't do that in C#. Any ideas or pointers to docs?

    M T 2 Replies Last reply
    0
    • K krism42

      We have a web service that is growing large enough that we wish to seperate logic. Ideally, we would have multiple code files on the server, and the service itself would still appear to be the same to consumers of it. If we were doing it in c++, we would simply split the implementation of our WebService class across several .cpp. Of course, we can't do that in C#. Any ideas or pointers to docs?

      M Offline
      M Offline
      Matt Newman
      wrote on last edited by
      #2

      Well, in VS2005/C#2.0 you have partial classes if thats what you mean (spreading the implimentation across files). But I don't see why you couldn't just have the webservice methods call methods in other classes. Matt Newman
      Even the very best tools in the hands of an idiot will produce something of little or no value. - Chris Meech on Idiots

      K 1 Reply Last reply
      0
      • M Matt Newman

        Well, in VS2005/C#2.0 you have partial classes if thats what you mean (spreading the implimentation across files). But I don't see why you couldn't just have the webservice methods call methods in other classes. Matt Newman
        Even the very best tools in the hands of an idiot will produce something of little or no value. - Chris Meech on Idiots

        K Offline
        K Offline
        krism42
        wrote on last edited by
        #3

        Another part of it is wanting to group methods by thier function; e.g. multiple webservices in one. So from the WSDL, you'd have Service1 { func1(); func2(); } Service2 { func1(); func2(); } Your information about 2005 helps though - that may end up being our solution. :)

        1 Reply Last reply
        0
        • K krism42

          We have a web service that is growing large enough that we wish to seperate logic. Ideally, we would have multiple code files on the server, and the service itself would still appear to be the same to consumers of it. If we were doing it in c++, we would simply split the implementation of our WebService class across several .cpp. Of course, we can't do that in C#. Any ideas or pointers to docs?

          T Offline
          T Offline
          Tom Larsen
          wrote on last edited by
          #4

          What do you mean "large enough"? Is it too large to maintain on the server or is it too large for any client to handle? Any good enterprise application has multiple layers of implementation to facilitate stuff like this. The exposed web service is just another layer in the API so nothing says it needs to needs to match any actual implementation details. You may have 100 objects that that are needed to make the web service "http://server/service" function but changing any one of them shouldn't change the service definition itself. You should be able to modify any of the 100 objects and not have to modify the interface for the web service. If this isn't happening now then you should rethink about the design. Although partial may help, your team should really be asking themselves do they really need a gigantic object so large it needs to span multiple files?

          K 1 Reply Last reply
          0
          • T Tom Larsen

            What do you mean "large enough"? Is it too large to maintain on the server or is it too large for any client to handle? Any good enterprise application has multiple layers of implementation to facilitate stuff like this. The exposed web service is just another layer in the API so nothing says it needs to needs to match any actual implementation details. You may have 100 objects that that are needed to make the web service "http://server/service" function but changing any one of them shouldn't change the service definition itself. You should be able to modify any of the 100 objects and not have to modify the interface for the web service. If this isn't happening now then you should rethink about the design. Although partial may help, your team should really be asking themselves do they really need a gigantic object so large it needs to span multiple files?

            K Offline
            K Offline
            krism42
            wrote on last edited by
            #5

            Most of the logic is in other objects. It's just that this particular .asmx is going to end up being huge and it becomes a pain in the rear to deal with - to add a new function or hunt another down.

            T 1 Reply Last reply
            0
            • K krism42

              Most of the logic is in other objects. It's just that this particular .asmx is going to end up being huge and it becomes a pain in the rear to deal with - to add a new function or hunt another down.

              T Offline
              T Offline
              Tom Larsen
              wrote on last edited by
              #6

              Your team should be spliting the web service *anyway* into more managable functional groups. If you are lumping everything into one giant object then it is a poor design that will cause problems down the road because it will grow like a cancer. Changing one large object/web service is trickier than one small one in an API with hundreds of objects. Regression over one large object/web service is more costly than one of many small ones. Resources consumed for one large object/web service is more "brutal" than many small ones. So on and so forth... Since it seems like a design issue there is no amount of coding or tricks that will help. The fact you are asking how to do break the object into multiple code files seems to indicate you know what is functionally disperate anyway. If you are already considering breaking up a large object into multiple files then why not break the object along those same functional lines?

              K 1 Reply Last reply
              0
              • T Tom Larsen

                Your team should be spliting the web service *anyway* into more managable functional groups. If you are lumping everything into one giant object then it is a poor design that will cause problems down the road because it will grow like a cancer. Changing one large object/web service is trickier than one small one in an API with hundreds of objects. Regression over one large object/web service is more costly than one of many small ones. Resources consumed for one large object/web service is more "brutal" than many small ones. So on and so forth... Since it seems like a design issue there is no amount of coding or tricks that will help. The fact you are asking how to do break the object into multiple code files seems to indicate you know what is functionally disperate anyway. If you are already considering breaking up a large object into multiple files then why not break the object along those same functional lines?

                K Offline
                K Offline
                krism42
                wrote on last edited by
                #7

                I agree. The problem is I have not been expressing myself clearly. What I want is multiple web services in the same .wsdl. (Like how MapPoints web service does it.) So the end user only has to know http://foobar/service/Product.asmx?wsdl; so they only need to configure one URL in thier application, rather than have 4 or 5 seperate web services, each with URL and proxy settings configured independantly. :mad: And before any tells me it's not possible, LOOK AT THE WSDL SPEC. Look at Mappoint! sheesh. [/end grouchy part]

                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