Https error in WCF Web Api REST service
I've a windows xp machine with IIS 5.1 and I've signed the Default Web Site with a self created certificate. Now I've a REST service built using WCF Web API running under the default web site and when I try to invoke a particular resource I'm getting the followinng error.
The provided URI scheme 'https' is invalid; expected 'http'. Parameter name: context.ListenUriBaseAddress
This is my configuration,
<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>
<webH开发者_开发知识库ttpBinding>
<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" />
This is the resource class,
[ServiceContract]
public class QuartzResource
{
[WebGet(UriTemplate = "")]
public List<Job> GetJobs()
{
...
return allJobs;
}
}
This is my Global.asax.cs,
protected void Application_Start(object sender, EventArgs e)
{
RouteTable.Routes.MapServiceRoute<QuartzResource>("");
}
Note: Things are working fine when runs in VS dev server.
精彩评论