[ServiceContract(Namespace = "MyAjaxService")]
public interface ICal
{ [OperationContract]
[WebGet]
double Add(double x1, double x2); }
You can create an AJAX endpoint on the service by using the webHTTPBinding
The enableWebScript behavior sets the default data format for the service to JSON instead of XML as shown below.
to change the Serializer
[WebInvoke(ResponseFormat=WebMessageFormat.Xml)] //WebMessageFormat.JSon for Json Serializer
Public string HelloWCF()
{ Return “Hello WCF” }
For client follow any one of the technic
Add an ASP.NET AJAX Endpoint with out using Configuration
or
Use configuration to add an AJX Endpoint.
No comments:
Post a Comment