I added the following service configuration to allow my method to be called via Ajax.
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="webHttpBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="webHttpXDomain" crossDomainScriptAccessEnabled="true" />
</webHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="ServiceBehavior" name="My.Service.AccountService">
<endpoint address="" behaviorConfiguration="webHttpBehavior"
binding="webHttpBinding" bindingConfiguration="webHttpXDomain"
name="Scripting" contract="My.Service.ServiceContracts.IAccountService" />
</service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
But now when I try to use WCF Test Client or run my unit tests it says no endpoint listening or comes up with nothing. The ajax client is working fine.