c# - How to use WCF service to support Web Application as well as Mobile Application? -


i want develop web application wcf service supports not web application mobile application doing manipulation using json.

so can suggest best architecture , how implement it?

update

here have tried far

1) structure of application

enter image description here

2) ihelloservice.cs

enter image description here

3) helloservice.svc

enter image description here

4) business logic in factory - serviceprofile.cs

enter image description here

4) entity - profile.cs

enter image description here

5) calling service on page

enter image description here

this work fine!! when access service through android app must return json. got stuck. how use same service can used both side.

to test service used ajax call below.

 $.ajax({             url: "service/helloservice.svc/testservice",             type: 'post',             //datatype: 'json',             //contenttype: "application/json; charset=utf-8",             data: json.stringify({ "_profile": [{ "name": "aijaz json" }] }),             success: function (data) {                 $('[id$="label1"]').text(data);             },             error: function (e) {              },             complete: function () { }         }); 

create restful wcf service. service provide data in json format can use in web app / mobile app.

more info: how create such service. http://www.compilemode.com/2015/09/creating-wcf-rest-service-to-get-json.html

i hope wanted.


Comments