If anyone ever rambling through the CodeProject forums in desperation for something like this, the answer is the SoapExtensionReflector Class. It does the trick by allowing you to override the WSDL through reflection on the fly. I found this after pouring through Google for a week. The link is here:
http://blogs.msdn.com/b/kaevans/archive/2005/11/16/493496.aspx[
^]
In case that ever goes away, just do this:
using System;
using System.Web.Services.Description;
namespace Msdn.Web.Services.Samples
{
public class HttpsReflector : SoapExtensionReflector
{
public override void ReflectMethod()
{
//no-op
}
public override void ReflectDescription()
{
ServiceDescription description = ReflectionContext.ServiceDescription;
foreach (Service service in description.Services)
{
foreach (Port port in service.Ports)
{
foreach (ServiceDescriptionFormatExtension extension in port.Extensions)
{
SoapAddressBinding binding = extension as SoapAddressBinding;
if (null != binding)
{
binding.Location = binding.Location.Replace("http://", "https://");
}
}
}
}
}
}
}
Using Visual Studio 2005, I created the class above and put it in the App_Code folder in my web site. Then, in the web.config file, I added the following section within configuration/system.web:
<webServices>
<soapExtensionReflectorTypes>
<add type="Msdn.Web.Services.Samples.HttpsReflector, App_code"/>
</soapExtensionReflectorTypes>
</webServices>