c# - WCF Service and ajax call in same project -
i hav c# web application. in have added wcf service file (.svc) right click project add new item >> wcf service (wcfservice.svc). ( have iwcfservice.cs , wcfservice.cs in app_code folder) , added function wcfxmldata(string id) inside that.
i trying access function inside wcf service file ajax call in application (in aspx file).
not able that.
also tried browse .svc file directly. there got message metadata publishing service disabled.
that depends on binding, if use webhttpbinding can simple access data via browser. in best case should modify contract in such way returns json, less overhead xml or soap (which uses xml).
it webpage implemented in webservice have nothing special care about, if service runs under subdomain need implement jsonp or cross-origin resource sharing (cors) manage cross domain calls.
Comments
Post a Comment