all groups > dotnet web services > march 2007 >
You're in the

dotnet web services

group:

Web Reference Generated Class C# VS 2005 edit?


Web Reference Generated Class C# VS 2005 edit? griff
3/31/2007 4:32:03 AM
dotnet web services:
I've run into an interesting set of problems. I need to override the
HttpWebRequest that is used by the autogenerated class from add a web
reference. I'm using C# in VS2005. I thought using a partial class would be
the way to do this.

It doesn't seem to work with the auto generated class. I've read (but don't
know for a fact) in some of discussion groups that the partial class concept
behaves differently in c# than in vb. It seems you have to use the partial
modifier in each class that makes up the whole class. The problem is the
auto generated class does not use the partial modifier and it also doesn't
allow you to edit it. Could this be why the partial class I'm creating is
not getting picked up correctly?

Thanks for any insight.
RE: Web Reference Generated Class C# VS 2005 edit? griff
4/2/2007 4:50:00 AM
I got around this problem by using the wsdl.exe to generate the web client
proxy class. I could then use the partial class to override the method.
Strange that the wsdl.exe utility generated the web service client proxy with
the partial modifier while the add web reference did not.



[quoted text, click to view]
AddThis Social Bookmark Button