Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Using a Class Factory to Return a Web Service

Reply
Thread Tools

Using a Class Factory to Return a Web Service

 
 
johntallon
Guest
Posts: n/a
 
      11-17-2005
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

 
Reply With Quote
 
 
 
 
Vishakha
Guest
Posts: n/a
 
      11-21-2005
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
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Abstract factory and Factory pattern C# ASP .Net 4 07-31-2008 03:22 PM
Data types in Pattern & Practices Web Service Software Factory Henrik Skak Pedersen ASP .Net Web Services 1 12-14-2006 07:20 AM
Web Service Factory: Creating a schema for a System.Collections.Generic.List<customer> Henrik Skak Pedersen ASP .Net Web Services 1 12-14-2006 06:17 AM
InvocationTargetException when calling "new Service()" in Axis web service to call another web service Michael Averstegge Java 0 01-10-2006 11:05 PM
Abstract Factory or Factory Method pattern question.... Medi Montaseri C++ 17 09-03-2003 06:50 AM



Advertisments