First, create a normal WCF Service, with service contracts, datacontracts etc.
To make it JSON / REST, follow these steps:
Modify the Web.Config:
Application_Start:
RouteTable.Routes.Add(new ServiceRoute("test", new WebServiceHostFactory(), typeof(MyService)));
(Add System.ServiceModel.Activation.dll as reference)
This will make the webservice available at the following URL:
http://mysite/test
Add this on the service implementation class:
[AspNetCompatibilityRequirements(RequirementsMode=AspNetCompatibilityRequirementsMode.Allowed)]
This puts the webservice in ASP.Net compatibility mode.
Add this attribute above methods that should be available using GET:
[WebGet(ResponseFormat = WebMessageFormat.Json)]
There's lots of outdated info online (.Net 3.5 and older).
This is a nice tutorial for JSON, WCF and .Net 4
http://christopherdeweese.com/blog2/post/drop-the-soap-wcf-rest-and-pretty-uris-in-net-4
Comments
Gg3vGFomR
17-07-2014
"??? = ????????"?????????? INI ??????? ????? ????????:XML allows arirtraibly complex levels and nesting, and has standard mechanisms for encoding binary data. INI files are typically limited to two levels (sections and parameters) and do not handle binary data well. ???? nesting ?????????? ????????? ?????? ??? ?????????? ?? ????? ??????.?????????.????????='INI rulez'???? ?????? ??? ????????? xml ????????? ?? ? ?????????????? (? ?????? ???????) ????? ??????.
SOAwR6Apdk
22-07-2014
I can't wait for that video! I'm currently<a href="http://rqnvxce.com"> hnavig</a> to write a Web API that requires some kind of Identity and Access Control. Also tying it into our AD system here.
lHfX0Gtvvl9
25-07-2014
I've watched all your PluralSight coseurs. Great job, thanks.When are you going have a course on Identity and Access Control for Web APIs?- Mike http://wjcjpqnnk.com [url=http://mreefzgilud.com]mreefzgilud[/url] [link=http://uhxggtkzc.com]uhxggtkzc[/link]
6hQkRBhiLC
29-07-2014
I doubt that all Windows 7 users will convert to Windows 8. I know that I am reedimcnomng that casual users (like my wife and some neighbors) stick with Windows 7. The reason is the silly Start screen in Windows 8 gives them nothing of value and a lot of confusion.I have gone to Windows 8 and most developers will follow suit. I think Windows 8 is a better OS but just too confusing for the those who just use their machine for simple stuff like email, web browsing, and a few Office apps. http://upgakldkx.com [url=http://gvrjszoxwr.com]gvrjszoxwr[/url] [link=http://uglkmownbxv.com]uglkmownbxv[/link]
For the love of God, keep writing these arcleits.
12-11-2015
For the love of God, keep writing these arcleits.
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. https://helloworld.com?h=c3e583a91014d5512a4026959ab9b1d2&
19-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. https://helloworld.com?h=c3e583a91014d5512a4026959ab9b1d2&
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. https://helloworld.com?h=c3e583a91014d5512a4026959ab9b1d2&
19-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. https://helloworld.com?h=c3e583a91014d5512a4026959ab9b1d2&
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=c3e583a91014d5512a4026959ab9b1d2&
20-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=c3e583a91014d5512a4026959ab9b1d2&
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=c3e583a91014d5512a4026959ab9b1d2&
21-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=c3e583a91014d5512a4026959ab9b1d2&
Buy legal anabolic steroids https://myfsk.org/community/account/buy-legal-anabolic-steroids/?h=c3e583a91014d5512a4026959ab9b1d2&
13-12-2020
Buy legal anabolic steroids https://myfsk.org/community/account/buy-legal-anabolic-steroids/?h=c3e583a91014d5512a4026959ab9b1d2&
Buy legal anabolic steroids https://myfsk.org/community/account/buy-legal-anabolic-steroids/?h=c3e583a91014d5512a4026959ab9b1d2&
13-12-2020
Buy legal anabolic steroids https://myfsk.org/community/account/buy-legal-anabolic-steroids/?h=c3e583a91014d5512a4026959ab9b1d2&
<p><a href="https://f3gxp.page.link/Tbeh"><img src="https://i.ibb.co/rH6Ky7F/best-hookup-sites-fs.jpg"></a></p>?h=c3e583a91014d5512a4026959ab9b1d2&
20-12-2020
<p><a href="https://f3gxp.page.link/Tbeh"><img src="https://i.ibb.co/rH6Ky7F/best-hookup-sites-fs.jpg"></a></p>?h=c3e583a91014d5512a4026959ab9b1d2&
<p><a href="https://f3gxp.page.link/Tbeh"><img src="https://i.ibb.co/rH6Ky7F/best-hookup-sites-fs.jpg"></a></p>?h=c3e583a91014d5512a4026959ab9b1d2&
21-12-2020
<p><a href="https://f3gxp.page.link/Tbeh"><img src="https://i.ibb.co/rH6Ky7F/best-hookup-sites-fs.jpg"></a></p>?h=c3e583a91014d5512a4026959ab9b1d2&
CsaOB
10-01-2021
Drugs information sheet. What side effects? <a href="https://prednisone4u.top">can you buy cheap prednisone pill</a> in Canada. Everything news about medicament. Get information here.
<a href=http://www.hespresso.it/_mg_5206ok/#comment-28595>Some news about medicine.</a> <a href=https://kure-yamada.jp/blog_articles/1594596810.html>Best information about medicine.</a> <a href=https://dananggroup.com/lien-he/dananggroup-zalo_-pay_/#comment-1010>Everything information about drug.</a> 144e8b7