Using a Class Factory to Return a Web Service

Discussion in 'ASP .Net Web Services' started by johntallon, Nov 17, 2005.

  1. johntallon

    johntallon Guest

    Hi People,

    I have a question regarding Web Service and Class Factories.

    I have a Collection of Web Services that do specific jobs. There are
    about 15 in all. These services are in one VS.NET project.

    I have created a Base Web Service Class, that implements Authenticate,
    Exception Handling and a few other common functions.

    My Other Web Service Classes inherit this Base web service, as well as
    add there own specific functionality, such as Login, Updates, and some
    other functionality.

    What I would like to do is use a Factory to Create the Appropreate Web
    Service by using a Parameter in the Factory.Create Class eg:

    BaseService Factory.Create(string ServiceName)
    {
    if(ServiceName == "User")
    return new UserService();

    if(ServiceName == "Lists")
    return new ListService();

    if(ServiceName == "Payments")
    return new PaymentsService();
    }

    Now I know that this code is not exactly right for WebServices, but I
    want to use the same Pattern.

    Is there a way I can call a factory to Create a Service which is
    derived from the baseService Web Service?

    Any Ideas would be great...

    Thanks
     
    johntallon, Nov 17, 2005
    #1
    1. Advertising

  2. johntallon

    Vishakha Guest

    Hi Johntallon!

    I want a list of web services which do some specific job for creating some
    forms in XSN.
    I would b very grateful if u send me the list of web services in u'r
    collection.

    Thanks,
    Vishu

    "johntallon" wrote:

    > Hi People,
    >
    > I have a question regarding Web Service and Class Factories.
    >
    > I have a Collection of Web Services that do specific jobs. There are
    > about 15 in all. These services are in one VS.NET project.
    >
    > I have created a Base Web Service Class, that implements Authenticate,
    > Exception Handling and a few other common functions.
    >
    > My Other Web Service Classes inherit this Base web service, as well as
    > add there own specific functionality, such as Login, Updates, and some
    > other functionality.
    >
    > What I would like to do is use a Factory to Create the Appropreate Web
    > Service by using a Parameter in the Factory.Create Class eg:
    >
    > BaseService Factory.Create(string ServiceName)
    > {
    > if(ServiceName == "User")
    > return new UserService();
    >
    > if(ServiceName == "Lists")
    > return new ListService();
    >
    > if(ServiceName == "Payments")
    > return new PaymentsService();
    > }
    >
    > Now I know that this code is not exactly right for WebServices, but I
    > want to use the same Pattern.
    >
    > Is there a way I can call a factory to Create a Service which is
    > derived from the baseService Web Service?
    >
    > Any Ideas would be great...
    >
    > Thanks
    >
    >
     
    Vishakha, Nov 21, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Medi Montaseri
    Replies:
    17
    Views:
    914
    Medi Montaseri
    Sep 3, 2003
  2. Simon Elliott
    Replies:
    0
    Views:
    396
    Simon Elliott
    Jan 11, 2005
  3. C#
    Replies:
    4
    Views:
    434
  4. Henrik Skak Pedersen

    Data types in Pattern & Practices Web Service Software Factory

    Henrik Skak Pedersen, Dec 13, 2006, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    185
    Steven Cheng[MSFT]
    Dec 14, 2006
  5. Henrik Skak Pedersen
    Replies:
    1
    Views:
    234
    Steven Cheng[MSFT]
    Dec 14, 2006
Loading...

Share This Page