background preloader

Api

Facebook Twitter

Pranay Rana: Steps to Call WCF Service using jQuery. Download Code This article illustrates how to call Windows Communication Foundation (WCF) services from your jQuery client code, and points out where special care is needed. Before you start reading and following this article, first read this blog entry which describes how to create a WCF service: Create, Host(Self Hosting, IIS hosting) and Consume WCF servcie Step 1 Read more about this in detail here: WCF Web HTTP Programming Object Model Following line of code set ASP.NET Compatibility mode Service.Cs Step 2 Next you need to specify attributes at operation level in the service contract file for each method or operation.

As you can see in the code, sub-attributes having values to support calling via jQuery are marked with Method=post, so data gets posted to the service via a POST method. ResponseFormat = WebMessaeFormat Json indicate data return as json format. IService.cs Step 3 Step 4 To set the request, first define a variable. Summary. Creating REST Service step by step Tutorial. Objective This article will give a step by step visual explanation of how to create a REST enabled WCF service. BackgroundI have written before also REST enabled service. I was success to create REST service but now I realized that was the bit complex way.

To have an understanding of REST service read my other articles. Create an empty web site. Step 2Right click on the project in solution and add WCF Service as new item. Step 3We are going to create a very simple service. Constructing URI to invoke the service The above function will get call by The above function will get call by So , contract could be consolidted as ISearch.cs Few Points to be noted Add namespace System.ServiceModel.Web There are two methods WebGet and WebInvoke is available WebGet is for HTTP Get operation WebInvoke is for otherHTTP operations. Getting Started with WCF. Introduction WCF is good. Perhaps great. It fixes a bunch of problems we never knew existed, and adds a bunch more brand new, exciting ones. If you use Web Services, .NET Remoting, or any other wacky scheme to have a program communicate with another program (or application tier or server or process or whatever), WCF is for you.

It’s very powerful. For quick solutions to some of the more common pitfalls you may encounter, and to read the next WCF article I'm writing section by section as it's written and revised, check out www.slickit.ca. Building a Basic WCF Service WCF is based around the idea of Services. Imports System.ServiceModel <ServiceContract()> _ Public Class Test <OperationContract()> _ Public Function GetLocalTime(ByVal includeDate As Boolean) As String If includeDate Then Return Now.ToString Else Return Now.TimeOfDay.ToString End If End Function End Class As you can see, it’s really just an ordinary class.

Believe it or not, that’s it. Hosting a Basic WCF Service in IIS History. Building a REST API architecture in MVC 3 - I Want My MVC. Posted on August 10th, 2011 ASP.NET MVC 3, with its glorious URL structures and ease of working with and controlling HTTP request/response data is primed to build REST type API services. But how does one accomplish that and what does the whole RESTful thing really mean? Building a full blown API (of any type) involves a lot of architecture components, from data validation to security and beyond. This post does not attempt to address all of that. It focuses on the initial structure of a RESTful service within an ASP.NET MVC 3 application that works with JSON data in and out.

We start by making use of Areas in MVC to create an API Area within an application. Our sample API will handle Comment data. Namespace Website.Areas.Api.Models{ public class Comment { public int Id { get; set; } public string Subject { get; set; } public string Body { get; set; } public string AuthorName { get; set; } }} The API will support sending and receiving JSON structured data. Or a batch of Comments: Routing. Salesforce Integration with .Net Web Services SOAP API. Introduction Salesforce is the top rated sales application in the world today. This success is greatly attributed to the built-in CRM functionality, a plethora of extensibility options, and ease of use. Since the multitenant platform is cloud-based, companies can focus on their core business and not worry about maintaining an elastic and dependable infrastructure. One key feature of Salesforce is its straightforward manner of extending functionality.

Web Services SOAP API The first aspect of integration with the Salesforce that will be looked at is the Salesforce Web Services SOAP API. Figure - API WSDLs in Salesforce Let’s start exploring the SOAP API functionality by creating a sample .Net application and connect into Salesforce. Create an empty ASP.Net MVC application. Building the Connection Now that the base project is created and a reference setup to the Enterprise WSDL, we can transition to writing code that calls the API.

Figure - Sequence Diagram API Request Flow ApiService.cs Class. Fx • Framework • API Reference • KendoUI Documentation. All Kendo effects support the following methods: duration Sets the effect duration. Parameters duration Number The number of milliseconds it will take for the effect to reach its final state. Returns Effect the effect instance for further usage Example <div id="foo"> I will be animated </div><script> kendo.fx($("#foo")).fadeOut().duration(2000).play(); </script> direction Sets the effect direction.

Note certain effects (like Transfer, for instance) do not have a direction. direction string The effect direction. <div id="foo"> I will be faded in </div><script> kendo.fx($("#foo")).fadeOut().direction("in").play(); </script> play Plays the effect Promise a jQuery promise instance, which can be used for callbacks, or passed to jQuery.when. <div id="foo"> I will be faded out </div><script> kendo.fx($("#foo")).fadeOut().play().then(function() { console.log("Foo faded out"); }); </script> reverse Plays the effect in reverse. stop Stops the effect in its current state. Get list of files on a web directory using mvc 4 razor web api and use that api in another project to list files in a gridview or anything else.