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 / October 2005

Tip: Looking for answers? Try searching our database.

Implementing Interface in the Proxy Class

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
HenrySeque - 14 Sep 2005 17:08 GMT
I have a webservice and I add a web reference from my web project.

I want the proxy class to implements an Interface, but I didn't find the
source code of the proxy class and I don't want to create a Wrapper for the
proxy.

Where is the source code? What can I do?
Signature

Henry Sequeira
Costa Rica

Marvin Smit - 19 Sep 2005 11:41 GMT
Hi,

use the magic button in Visual Studio (Show all files).
This will allow you to expand your webreference and see the generated
proxy code and types.

I do however want to stress that "modifying generated code" is just
not a smart thing to do. Next generation... your code is history!

My advise would be to:

- Derive from the proxy
- Add Interface inheritance to the newly derived class.

Hope this helps,

Marvin Smit.

>I have a webservice and I add a web reference from my web project.
>
[quoted text clipped - 3 lines]
>
>Where is the source code? What can I do?
HenrySeque - 19 Sep 2005 16:27 GMT
Thanks Marvin.

I forgot to say that I´m working with VS.NET 2005. For some reason the proxy
class is hidden or does not exists.

I'm still looking for.

Thanks for your advice.

Signature

Henry Sequeira
Costa Rica

> Hi,
>
[quoted text clipped - 21 lines]
> >
> >Where is the source code? What can I do?
cPetru - 20 Sep 2005 14:03 GMT
The easyest way to see the generated proxy class (as far as I know) is:
write some code in Visual Studio 2005 using the proxy class and then right
click on the proxy class's name and then "Go To Definition".

Best Regards,
Petru

> Thanks Marvin.
>
[quoted text clipped - 30 lines]
> > >
> > >Where is the source code? What can I do?
HenrySeque - 20 Sep 2005 22:21 GMT
Thanks Petru.

I found the source code (with your technique), but is not posible to change
the source code, is read only and is hidden, I think VS2005 could change it
without warning me.

So, my other option is to use de wsdl.exe tool, I'll generate the proxy and
then I work directly with the proxy class.

I'll try this approach, if some of you have a better idea, please share it
with us.

Signature

Henry Sequeira
Costa Rica

> The easyest way to see the generated proxy class (as far as I know) is:
> write some code in Visual Studio 2005 using the proxy class and then right
[quoted text clipped - 37 lines]
> > > >
> > > >Where is the source code? What can I do?
Tiberiu Covaci - 27 Oct 2005 08:06 GMT
Hi Henry,

Another solution is to create a derived class that inherits form your proxy
class, and implements the interface. I assume that you already have the
mothods that you want to expose via the interface, so you will have an empty
derived class. EX:
If your webservice class is MyWebservice and your interface is
IMyWebInterface then you will hava a class

public class MyDerivedWebServiceWithInterface : MyWebservice,
IMyWebInterface {
}

That is all.

Best Regards,

Tiberiu Covaci

> Thanks Petru.
>
[quoted text clipped - 56 lines]
>> > > >
>> > > >Where is the source code? What can I do?

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.