The WebGetAttribute attribute is applied to the Add operation to ensure that the service responds to HTTP GET requests. The code uses GET for simplicity (you can construct an HTTP GET request from any Web browser). You can also use GET to enable caching. We can also add the WebInvokeAttribute attribute to explicitly specify HTTP POST, or not specify an attribute, which defaults to HTTP POST.
[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 standard binding and the enableWebScript behavior in the service configuration file.
The enableWebScript behavior sets the default data format for the service to JSON instead of XML as shown below.
to change the Serializer
[OperationContract]
[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 ConfigurationorUse configuration to add an AJX Endpoint.
A feature is like a site definition: a directory containing CAML-based XML files and page templates. The Feature is a container of various defined extensions for SharePoint.
Features provide the following capabilities:
- Pluggable behavior for installing or uninstalling Features within a deployment.
- Pluggable behavior for activating or deactivating Features at a given scope.
Features can be activated on an existing site. For example, we can create a feature that defines a custom list type, an instance of that list type, and an event handler or workflow on that list instance. Once the feature has been installed, it can be activated in any site within a farm and you can activate it through the WSS user interface, from the command line, or through custom code written against the WSS object model. Once the feature has been activated, the site will include the new custom list and any behavior we want to attach to it.
Location:
Local_Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES
Scope & Accessibility
• Site Scope
Only available for the root site of a site collection and is not displayed in the sub sites, Available only on the Site Collection Features page, accessible from the Site Actions menu.
• Web Scope
Available on every web site including the root of the site collection
• Web Application Scope
Available to all sites in all site collections of the web application and they can be activated and deactivated from Central Administration > Application Management > Manage Web Application Features.
• Farm Scope
Available to all web application in the Farm level. Accessible from Central Administration > Operations > Managers Farm Features.