I do not think it is possible, but if I need it :)
I have an automatically generated proxy file from the wsdl.exe command line tool using Visual Studio 2008.
Proxy output is partial classes. I want to override the default constructor. I would prefer not to change the code as it is auto-generated.
I tried to make another partial class and override the default constructor, but this will not work. Then I tried to use redefinition and new keywords, but this does not work.
I know that I could inherit from a partial class, but that would mean that I would have to change all of our source code to point to the new parent class. I would rather not do this.
Any ideas, work around or hacks?
//Auto-generated class namespace MyNamespace { public partial class MyWebService : System.Web.Services.Protocols.SoapHttpClientProtocol { public MyWebService() { string myString = "auto-generated constructor"; //other code... } } } //Manually created class in order to override the default constructor namespace MyNamespace { public partial class MyWebService : System.Web.Services.Protocols.SoapHttpClientProtocol { public override MyWebService() { //this doesn't work string myString = "overridden constructor"; //other code... } } }
override c # wsdl overriding web-services partial-classes
Elijah Manor Oct 29 '08 at 18:02 2008-10-29 18:02
source share