Hi,
I'm trying to self-host a WCF web service and provide a HTTP endpoint with ajax support. Pretty much everything I've found about WCF and AJAX are talking about IIS, which I don't want to use.
I've build a simple Console App to host the service. My service only have a single method:
[ServiceContract]
interface IMyService
{
[OperationContract]
string TestConnection();
}
And here's the app.config code:
<services>
<service name="Service.MyService" behaviorConfiguration="MyServiceBehavior" >
<endpoint address="" binding="webHttpBinding" behaviorConfiguration="WebBehavior" contract="Service.IMyService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="WebBehavior">
<enableWebScript/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="MyServiceBehavior" >
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
I can access the service metadata endpoint and see the WSDL, but I'm unable to use it from my ajax client. So my question are : 1. Is it possible to do this? 2. What is the needed configuration that I'm obviously missing?
NOTE I'm not using a .svc file
Thanks!