Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
<<pre lang="C#">b></b>I wrote rest services using WCF services,It's working in Local machine and i can access rest services,but When i host into IIS,it's not displaying any services.

<b>Web.congig</b>

<system.serviceModel>
<services>
<service name="WCFService.RestService" behaviorConfiguration="serviceBehaviour">
<endpoint address="" binding="webHttpBinding" contract="WCFService.IRestService" behaviorConfiguration="web"></endpoint>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="serviceBehaviour">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>

<b>ServiceContract</b>

[ServiceContract]
public interface ILoginService
{
[OperationContract]

[WebInvoke(Method = "GET",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
UriTemplate = "login/{userId},{password}")]
string CheckLogin(string userId, string password);
}

For Hosting into IIS,I refereed this website.

<a href="http://social.technet.microsoft.com/wiki/contents/articles/1265.hosting-a-wcf-rest-service-on-iis.aspx">TechNet Wiki</a>[<a href="http://social.technet.microsoft.com/wiki/contents/articles/1265.hosting-a-wcf-rest-service-on-iis.aspx" target="_blank" title="New Window">^</a>]


<a href="http://dotnetmentors.com/how-to-host-wcf-service-in-iis-7.aspx">How to host wcf service in IIS 7.0 or 7.5 : www.dotnetmentors.com</a>[<a href="http://dotnetmentors.com/how-to-host-wcf-service-in-iis-7
.aspx" target="_blank" title="New Window">^]
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900