Grinn Grinn - 2 months ago 18x
ASP.NET (C#) Question

Inherited properties do not appear in soap sample on asmx file

I have two classes, WebServiceRequest and OrderRequest. Each class has properties. OrderRequest inherits from WebServiceRequest - like so:

public class WebServiceRequest
private string mAuthenticationToken;

public string AuthenticationToken
get { return mAuthenticationToken; }
set { mAuthenticationToken = value; }

public class OrderRequest : WebServiceRequest

private string mVendorId;
public string VendorId
get { return mVendorId; }
set { mVendorId = value; }

OrderRequest is exposed via a WebMethod. When viewing the WSDL of the ASMX file that exposes OrderRequest (i.e. MyWebService.asmx?WSDL), both properties are visible - as they should be. However, when you view the SOAP Sample for the Web Method that exposes OrderRequest, only the VendorId property is visible, and not the inherited AuthenticationToken property. What's the deal?

Note: I've posted this issue as a bug on MS Connect:


I managed to stumble back-asswords into the solution for my problem, even after Microsoft confirmed it as a bug ( and I had given up and marked John's answer as accepted. Here's the solution:

Go there, download the file, then add the following line under the system.web section of your Web.config file:

 <wsdlHelpGenerator href="CustomWsdlHelpGenerator.aspx"/>

The href property should point to the relative location of your file within your project. Thanks for your help John.