Reputation: 11652
I developed simple http:// Web service and deployed. Now we are planning to get certificate on the web site. Do I need change in my code? I am new to SSL side.
Please advice me
Upvotes: 2
Views: 13165
Reputation: 31
Easy solution for your problem create a class with the code given below
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://");
}
}
}
}
}
}
}
change the web config with following
<soapExtensionReflectorTypes>
<add type="xxx.WebServices.HTTP.HttpsReflector, App_code"/>
</soapExtensionReflectorTypes>
Upvotes: 3
Reputation: 1708
You will need to change the config file in any client applications that consume your service to the new URL.
Your web service application should not require any changes. IIS will handle the transport encryption with the SSL certificate.
This is worth a read:
http://msdn.microsoft.com/en-us/library/ff649205.aspx
Upvotes: 4