views:

118

answers:

3

Hi,

I have a bog standard html page. All I want to do is :

  • use JQuery on that page to send JSON requests to a WCF service
  • retrieve JSON back.

That's it.

I have the html page and JQuery written, no problem.


However, I can't find one tutorial that works. All the ones I've found have many conflicting parts to do with behaviors, editing the svc file with a Factory attribute, etc.

Can someone please point me to a bog standard tutorial / example that ACTUALLY works?

Thanks.

A: 

Rick Strahl has a pretty good resource for this:

More importantly, he has a full sample project he uses in his DevConnection talks here:

I always find using a full blown project I can fire up in Visual Studio is a much better resource than any walk through... hopefully the same is true for you.

Nick Craver
A: 

I have finally been able to get this to work using WCF 4.0

USING windows comunication foundataion WCF 4.0 (.net 4.0)

I have wasted a lot of my time....so I wanted to share my knowledge on how to do this.

PLEASE SEE MY WEB SITE FOR AN EXAMPLE: http://douglubey.com/Jquery_WCF4_JSON_webConfig_Settings_Plus_Bindings_For_WebHttp_And_BasicHttp.aspx

Doug Lubey of Louisiana
A: 

Another quick creation of WCF service is using *.svc like
<%@ServiceHost language=c# Service="Microsoft.Samples.MyWCFService" Factory="System.ServiceModel.Activation.MyWebServiceHostFactory" %>

This does not require you to have any configuration in your web.config file and this Factory automatically instantiates your service and as this service runs under the same web-app process thread, it shares the Session with your asp web-application.

Ajaxe