Tuesday, July 31, 2007

WCF 3.5 Beta2

in WCF 3.5 beta2 , there is a built-in support for Json/Pox support. the service can intercept the client request and bring the Json style object to the client. here is a 5 minutes demo.

first. Add a ajax enabled WCF Service.




then. implement a service which return a object






in the webpage, you can add a service reference to the scriptmanager.


which will render a script proxy to invoke the service .

then in code, can call the wcf service.

function ShowfamousPerson()

{ tempuri.org.HelloWorld.FamousPerson(0, OnComplete); } //you can change the namespace by adding a attribute

function OnComplete(obj) { alert("welcome : " + obj.Name); }


No comments: