Click here to Skip to main content
15,885,877 members
Articles / Programming Languages / C#

Calling WCF service exposed with different bindings in JQuery

Rate me:
Please Sign up or sign in to vote.
4.84/5 (16 votes)
10 Jan 2012CPOL5 min read 107.6K   4.7K   64  
The article illustrates how to call differently exposed Windows Communication Foundation services from JQuery.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace MyWcfService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IMyService
    {

        [OperationContract]
        [WebGet(UriTemplate = "/data?id={value}", ResponseFormat = WebMessageFormat.Json)]
        string GetData(int value);

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions