Configuring WCF 4 with routing (global.asax) for both http & https endpoints
Posted
by jammer59
on Stack Overflow
See other posts from Stack Overflow
or by jammer59
Published on 2010-06-16T19:57:28Z
Indexed on
2010/06/16
20:02 UTC
Read the original article
Hit count: 1584
I'm still a newbie with wcf and not too well informed in .net in general. I have a WCF 4 web service that uses the global.asax routing approach and very simplified web.config using the standard endpoint method. This wcf service runs as an application with the default web site on iis 7.5 at present. I need it support both http and https interfaces, if possible. If that's too complex then only https. How is that best handled maintaining the current approach?
The contents of the global.asax.cs and web.config files are pretty basic:
public class Global : HttpApplication
{
void Application_Start(object sender, EventArgs e)
{
RegisterRoutes();
}
private void RegisterRoutes()
{
// Edit the base address of Service1 by replacing the "ippay" string below
RouteTable.Routes.Add(new ServiceRoute("myservice", new WebServiceHostFactory(),
typeof(myservice)));
}
}
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="true" contentTypeMapper="myservice.Util.RawMapper,myservice">
</standardEndpoint>
</webHttpEndpoint>
</standardEndpoints>
© Stack Overflow or respective owner