我仍然是wcf的新手,并且在.net中一般都不太了解.我有一个WCF 4 Web服务,它使用global.asax路由方法,并使用标准端点方法非常简化web.config.此wcf服务作为应用程序运行,目前在iis 7.5上使用默认网站.如果可能的话,我需要它支持http和https接口.如果那太复杂,那么只有https.如何最好地维持当前的方法?
global.asax.cs和web.config文件的内容非常基本:
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>
Run Code Online (Sandbox Code Playgroud)