Author: xeonet | Posted on: 6/5/2009 6:30:10 AM | Views : 494

Hello. I have such Ajax-enabled WCF service from JavaScript. How can I call it from JavaScript direclty. Not using asp.net runtime. I need to use the script in different hosts. Thanks in advance. [ServiceContract(Namespace = "")] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class PubAd { [OperationContract] [WebInvoke(RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)] public ResponseData GetSingleAdPlacement(RequestData data) { if (String.IsNullOrEmpty(data.ipAddress)) data.ipAddress = HttpContext.Current.Request.UserHostAddress; var adEngine = new AdEngine(); var responseData = adEngine.GetSingleAdPlacement(data); return responseData; } } ...

Go to the complete details ...