小编Jef*_*ier的帖子

为http和https端点配置带有路由(global.asax)的WCF 4

我仍然是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)

ssl wcf web-services

7
推荐指数
1
解决办法
1万
查看次数

标签 统计

ssl ×1

wcf ×1

web-services ×1