I have a web service which is behind a reverse proxy like this:
Now what is happening
What I did to solve a similar problem was to force the webservice to emit the correct headers.
You can do the following:
Create the following class in the App_Code
folder:
using System;
using System.Web.Services.Description;
namespace Msdn.Web.Services.Samples
{
/// <summary> Summary description for WSDLReflector </summary>
public class WSDLReflector : 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://mywebservice.comp.com", "https://uat.mywebservice.com");
}
}
}
}
}
}
}
And add this to web.config
:
<webServices>
<diagnostics suppressReturningExceptions="true" />
<soapExtensionReflectorTypes>
<add type="Msdn.Web.Services.Samples.WSDLReflector,App_Code"/>
</soapExtensionReflectorTypes>
</webServices>