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 / .NET Framework / New Users / July 2006

Tip: Looking for answers? Try searching our database.

Webservice proxy and override

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
patrick.sannes@gmail.com - 25 Jul 2006 14:59 GMT
Hi all,

I got the following problem. When I add a webref to a project it
generates (somewhere in the darsksides of the solution) a proxyclass.
If you follow the inheritance tree you get the following tree:
Component
WebClientProtocol
HttpWebClientProtocol
SoapHttpClientProtocol
MyProxy

In MyProxy I have to insert the following code to turn off keepalive
(that is becouse our current CICS version on our mainframe)
       protected override System.Net.WebRequest GetWebRequest(Uri uri)
       {
           HttpWebRequest request = new
(HttpWebRequest)HttpWebRequest.Create(uri);
           request.KeepAlive = false;
           return request;
       }

My main problem is that I have around 200 Webreferences for our
webapplication (old cobol programs). If I want to add the code to the
reference.cs (under the webreference) it will be destroyed when I do a
regenerate. If I generate a proxy with wsdl.exe, I have a lot of manual
work, that maybe have to be changed when we get a new CICS version.
I was hoping I could do it with the decorator pattern, but it is not
the one.

I hope someone have some suggestions to resolve this problem in a nice
way.

Regards,
Patrick
David Musgrove - 25 Jul 2006 16:26 GMT
Hi Patrick

There might be a workaround that, while not exactly "nice", could avoid the
need to recode when a reference is refreshed. Try setting the
ConnectionGroupName of your WebRequest object to some random string
(System.Guid.NewGuid().ToString() ought to do it!) before sending the request.

David

> Hi all,
>
[quoted text clipped - 30 lines]
> Regards,
> Patrick

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.