I did the search again and again but I don't really know what am I missing. I have WCF method and after calling, the service return with error 404, resource can not be found.
The url like this: localhost:3522/AccountService.svc/accountbalance/1
I run it from Visual with IIS 8 Express.
The WCF method like this
[ServiceContract]
public interface IAccountService
{
[OperationContract]
[WebGet(UriTemplate = "accountbalance/{accountId}")]
decimal GetAccountBalance(string accountId);
}
And this is my web.config
<bindings>
</basicHttpBinding>
<webHttpBinding>
<binding name="WebHttpBinding">
<security mode="Transport">
<transport clientCredentialType="Windows" proxyCredentialType="Windows" />
</security>
</binding>
</webHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="ProfileServiceDefaultBehavior"
name="MyWcfService.AccountService">
<endpoint behaviorConfiguration="RestFulBehavior" binding="webHttpBinding"
bindingConfiguration="WebHttpBinding" name="AccountServiceEndpoint"
bindingName="AccountServiceBinding" contract="MyWcfService.IAccountService" />
<endpoint address="mex" behaviorConfiguration="" binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="RestFulBehavior">
<webHttp automaticFormatSelectionEnabled="true" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="ProfileServiceDefaultBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />