473,372 Members | 1,277 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

Dynamically linking to webservice or COM DLL

I have a C# client application that uses a COM DLL(written in C++) or
a webservice (the
webservice is the same COM DLL wrapped up as a webservice). The client
can dynamically (based on form input) select to use the webservice or
the DLL. The front end interface and the implementaion code is the same

in either case. However the namespace and the main class used in either

case are different.
Is there anyway to implement this efficiently ?
Thanks in advance.

Jan 10 '06 #1
5 2324
lavu,

The best way to do this would be to use an interface, and implement a
class factory pattern. The COM object and the proxy would both implement
the interface, and then you can have a class factory create an
implementation when needed, based on the circumstances.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"lavu" <th******@yahoo.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
I have a C# client application that uses a COM DLL(written in C++) or
a webservice (the
webservice is the same COM DLL wrapped up as a webservice). The client
can dynamically (based on form input) select to use the webservice or
the DLL. The front end interface and the implementaion code is the same

in either case. However the namespace and the main class used in either

case are different.
Is there anyway to implement this efficiently ?
Thanks in advance.

Jan 10 '06 #2
Thank you. I am not familiar with the class factory pattern and am
going to read more about it.

Jan 10 '06 #3
I am re- introducing this thread after exploring the Class Factory
Pattern and
determining that it would not be suitable for me. The main reason is
that
the base class needs to be the same for both and in my case, the web
service and
the COM implementation does not have a common base class.
Are there any other ideas to implement this ?

Jan 11 '06 #4
lavu,

For a class factory to work, they don't necessarily have to have the
same base class. They can share the same interface implementation. You CAN
do this in this case, which is what I actually recommended in my previous
post.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"lavu" <th******@yahoo.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
I am re- introducing this thread after exploring the Class Factory
Pattern and
determining that it would not be suitable for me. The main reason is
that
the base class needs to be the same for both and in my case, the web
service and
the COM implementation does not have a common base class.
Are there any other ideas to implement this ?

Jan 11 '06 #5
Nicholas,

Thanku for your efforts. I am hoping you can help me with some
suggestions based on the scenario that I will explain below:

I have a COM dll from which I can instantiate an object of type Class A
in my client.
I have a webservice from which I can instantiate an object of type
Class B in my client.
I need to have a common reference to either object which will be done
at run-time. I do not have access to the actual DLL or the webservice.
How can I use an interface to implement this ?

Jan 11 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Germic | last post by:
Hi, How can we dynamically create a wrapper for an webservice? Example : I write an client application in C# that consumes a webservice, I need that application to read the URL of the WSDL file...
3
by: T-Man | last post by:
Hello, I have an application in C# that makes calls to a web service and the app currently contains a reference to a WSDL. Since the server technology is a commercial product, some customers...
0
by: Kristof Thys | last post by:
Hello, I am writing a webservice for some older c++ classes. I build these unmanaged classes as a dll, and in my webservice I add a reference to this dll. I include the necessary headerfiles,...
1
by: Ed S | last post by:
Hi All, We're upgrading our web project - currently we have a web app and a web service - both written in C#. The web app communicates with the web service for login authentication, the list of...
2
by: Call Web service dynamically. | last post by:
I have VC++.NET application which takes the Webservice URL at the runtime from the user and it should call the webservice method based on what the user has supplied.
1
by: satyaashok | last post by:
first iam create a webservice and it is consume in client web application now change parametars in the webservice ,now in client application with out update the webservice, it is update dynamically...
20
by: pratap | last post by:
Could someone clarify how could one reduce the size of an executable code during compile time. Could one use specific compile time flag with makefile or is it advisable to go for dynamic linking....
36
by: Martin Larsen | last post by:
Hi, When a PHP program links to a library using include or require (or their _once variations), is the library then linked dynamically or statically? While it might seem irrelevant from a...
0
by: amollokhande1 | last post by:
Hi, I have one xml node containing webservice information. <Webservices> <Webservice id="1" name="WebServiceOfTheDay"> <Messagedata> <Message id="1" method="HTTPPost"...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.