JSON in WCF
A lot of people know about WCF supports XML as the return response. Actually, it supports JSON. All you need to set ResponseFormat.
Code
[WebGet(ResponseFormat=WebMessageFormat.Json)] | |
[OperationContract] | |
public SessionKeyDTO Authenicate(string username, string password) |
And you need to set web.config
Code
<behavior name="AdvCMS.Services.Service2AspNetAjaxBehavior"> | |
<webHttp/> | |
<enableWebScript /> | |
</behavior> |
It needs <webhttp/>. That is easy!
The code is a part of our CMS, AdvGenCMS.
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
Feedback awaiting moderation
This post has 10 feedbacks awaiting moderation...
Form is loading...