Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / April 2006

Tip: Looking for answers? Try searching our database.

Implement Interface and Cast to Web Service?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
xenophon - 27 Mar 2006 23:11 GMT
I have an Interface compiled into a .dll, referenced in a VS.NET 2003
Web Service project. The default .asmx implements the Interface. All
of the Interface-defined methods return strings.

I have a WinForms client that also includes the Interface .dll in it's
compiler references.

I want to use the WinForms client to create a new instance of "foo"
that implements the Interface and dynamically cast foo to the web
service. Just to make things easy, I would like to at runtime specify
the URI of the web service so it can be put in a config file.

How can I do that?

Thanks.
Gabriel Lacatus - 03 Apr 2006 16:12 GMT
To be able to talk with the webservice you'll need a proxy class. Of course
if all of your services implement the same interface, creating web
references using vs will result in "similar" proxy classes. Of course what
you want is not to create all these proxies from the beginning but instead
to be able to dinamically switch between services without creating a proxy
for it inthe first place.
What you have to do is manually create some sort of universal proxy, by
sneak-peaking at what VS is generating for one of your services. If all is
done right this universal proxy should be able to "talk" with any of your
services. At runtime you'll just have to make one instance of this proxy,
set its url to the desired webservice and start calling remote functions.

HTH

> I have an Interface compiled into a .dll, referenced in a VS.NET 2003
> Web Service project. The default .asmx implements the Interface. All
[quoted text clipped - 11 lines]
>
> Thanks.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.