我有一台带有IIS 5.1的Windows XP机器,我用自己创建的证书签署了默认网站。现在我使用在默认网站下运行的WCF Web API构建REST服务,当我尝试调用特定资源时,我收到了以下错误。
提供的URI方案“https”无效;预计'http'。 参数名称:context.ListenUriBaseAddress
这是我的配置,
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule,
System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</modules>
</system.webServer>
<system.serviceModel>
<services>
<service name="QuartzResource">
<endpoint binding="webHttpBinding" contract="webHttpBinding"
behaviorConfiguration="webHttp" bindingConfiguration="bindConfig"/>
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="bindConfig">
<security mode="Transport">
<transport clientCredentialType="Certificate"></transport>
</security>
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="webHttp">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
这是资源类
[ServiceContract]
public class QuartzResource
{
[WebGet(UriTemplate = "")]
public List<Job> GetJobs()
{
...
return allJobs;
}
}
这是我的Global.asax.cs,
protected void Application_Start(object sender, EventArgs e)
{
RouteTable.Routes.MapServiceRoute<QuartzResource>("");
}
注意:在VS dev服务器中运行时,一切正常。