.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Imran Ghani
Post New Web Links

how to consume wcf 4.0 rest services in asp.net MVC

Posted By:      Posted Date: October 05, 2010    Points: 0   Category :ASP.Net


how to consume wcf rest services in asp.net MVC? there is any standards are available?

in my project SOA, so all the data came from wcf 4.0 rest services if there is any coding examples or resources to consume wcf services in MVC 2.0

View Complete Post

More Related Resource Links

Data 2.0: Expose And Consume Data in A Web Services World


The goal of the ADO.NET Data Services Framework is to create a simple REST-based framework for exposing and consuming data-centric services easily.

Elisa Flasko and Mike Flasko

MSDN Magazine August 2008

Multiple services in REST Collection WCF Service?


After I create a "REST Collection WCF Service" project, it contains one service "service.svc". Can I add multiple services to this project? There must be a way to do so. Otherwise, it does not make sense to create one project for each service.


My question is how to add a new service to an existing "REST Collection WCF Service" project?


Thanks a lot.

How to Consume (Cookieless =true) Session Enabled Web services

  Hi, I need to use cookieless=true in web.config and enablesession=true in web methods.   I've two web methods like, [WebMethod(EnableSession=true)] public void SetName(string Name) { Session["Name"] =Name; } [WebMethod(EnableSession=true)} public string GetName() { return (string)Session["Name"] }   In my aspx.cs, using proxy I want to call SetName in button 1 click, and retrieve the name (which i put it into web service session on button 1 click ) in button 2 click like,   protected void Button1_Click(sender o, eventargs e) { webserviceproxy proxy =new webserviceproxy(); proxy.SetName("Prabhu"); } protected void Button2_Click(sender o, eventargs e) { webserviceproxy proxy =new webserviceproxy(); Response.Write( proxy.GetName()); } Here, How can I use cookie container and how can i achieve what Im expecting to do?   Please help me on this. thanks Prabhu P Work Smart, Not Hard

Database Access Using SOAP and REST Web services

Hi Guys, Can anyone post the links regarding DATABASE ACCESS USING BOTH WEB SERVICES. How to query the database using the web service. Suppose i have SQL statement like " Select empID,empName,CName from employee,company where empID=CID;".  How to  send this sql query to database server using REST and SOAP web Services?  Thank You

Unable to consume ADO.NET Data Services from Silverlight.

Hi Everyone, I am having trouble consuming an ADO.NET Data Service from Silverlight.  I am able to get data back from a browser, but not in Silverlight. I am at a loss to figure this out.  Any help is much appreciated.  Let me know if you need more info. Thank you in advance for any help! Here is the the silverlight code: private Uri svcUri = new Uri("http://localhost:64522LocalTariffsDataService.svc"); private void ctrlViewLocalTariffs_Loaded(object sender, RoutedEventArgs e) { svcContext = new LocalTariffEntities(svcUri); svcContext.LocalTariffs.BeginExecute(OnLocalTariffsQueryCompleted, svcContext.LocalTariffs); } private void OnLocalTariffsQueryCompleted(IAsyncResult result) { Dispatcher.BeginInvoke(() => { DataServiceQuery<LocalTariffsEntityDataService.LocalTariff> query = result.AsyncState as DataServiceQuery<LocalTariffsEntityDataService.LocalTariff>; LocalTariffsEntityDataService.LocalTariff returnedLocalTarrifs = query.EndExecute(result).FirstOrDefault(); // Exception is thrown here. dgLocalTariffs.DataContext = returnedLocalTarrifs; }); } Here is the exception: < E2ETraceEvent xmlns = " http://schemas.microsoft.com/2004/06/E2ETraceEvent " >

Excel Services XLSX shows different results when accessed via Sharepoint UX vs REST

I have an Excel services report that connects to Project Server 2010 data via an ODC.  Looks great when I view the XLSX through the browser via the Sharepoint doc library; everything refreshes, no warnings, all is good.    But when I access this same file via the Excel Services REST call: https://myserver/_vti_bin/ExcelRest.aspx/ProjectBICenter/My%20Reports/Initiative%20Status%20Report.xlsx/model/PivotTables('InitiativeStatusSummary')?$format=html I get an older version of the report -- not refreshed with the latest data.   I have the file set to "refresh data when opening the file" in the data connectioon properties.     What am I missing?

sharepoint rest services

Hi, As per my knowledge , REST services are similar to SOAP services/protocol  but less head-ache. But why to use REST instead of SOAP in SharePoint 2010? Also I want what is a Mshup page in internet environment.   Thanks

host and consume wcf rest service in web project in single solution

I have  create a solution which have multiple class library project and a web application Like Web(UI),BL,DAL etc. I have also add a WCF REST starter kit Collection project in the same Solution.WCF Rest API is working fine if I host it on IIS but i want to consume this in my web project without using IIS. Is this possible? if yes then what will be the URI  for my WCF Rest services? Add service reference is also not working because WSDL is disable in rest.

null response when consume WCF REST API Using Jquery

I have created and hosted my WCF REST API Using WCF REST Starter Kit preview2. Which supports Dynamic Response and Request format type (XML and JSON).Everything is working fine if I consume the service through fiddler or Microsoft.Http and Microsoft.Http.Extensions on cs side. My cs code is as following: private void GetData() { string url = string.Format("http://myhost/Services/UserService.svc/people/"); HttpClient client = new HttpClient(); HttpResponseMessage responseMessage = client.Get(url); responseMessage.EnsureStatusIsSuccessful(); using (responseMessage) { string res = responseMessage.Content.ReadAsString(); Response.Write(res); } } now when I try to consume my service using Jquery Response is comming in IE8 but in Mozilla and Chrome I am getting null response My jquery code is as following : function loadData() { var path = "http://myhost/Services/UserService.svc/people/"; $.ajax({ type: "GET", url: path, contentType: "application/json; charset=utf-8", dataType: "json", async: false, success: function(response) { if (response != null) { displayData(response); } } }); } I am using visual studio 2008. I have also check jqeury call in firebug status shows 200 OK. can anyone help me?

Quick Note (Scenario): Using the Excel Services 2010 REST API

Learn to use the Excel Services REST API to access data and objects within a spreadsheet.

WCF ReST services not working in IIS 7.5


I know this has come up before, but I haven't seen an answer that fits this situation. I have a project in Visual Studio 2010 Ultimate RTM created with the "WCF REST Service Application" project template. It works fine in the Visual Studio development web server but I get 404.0 errors if I try to deploy it to IIS. I think IIS has all the correct .Net 4 stuff, but I'm not an IIS expert. I don't have a .svc file but I believe it shouldn't be necessary and, as I said, it works in the development server. Visual Studio and IIS are running on the same Windows Server 2008 R2 box.



Beginner in using Rest web services


Hi All,

I have a site that contains all the information about the employees of my company. They gae me documentatation to access. Please see below.

I am really confused.

1. Ask your  administrator to request a Service Account with appropriate privileges. - Done

2. Use your web browser to explore the read-only web services. Start by downloading the most
recent version of this document from the Documentation Resource. Next, view the Schema List
Resource to find your Schema Key(s), which is used by many other service resources.

(How can I do that???)

3. Consider installing the RESTTest Firefox Extension (a simple interface for testing readable and
writeable REST web services), available at http://www.xucia.com/#RestTest.
( I did installed the rest test but I dont know how to use it properly)

4. Find appropriate HTTP Connection sample code for your development platform.

I am able to connect to the site using the service account through the code.

but GET/POST request I dont know how can I make it if I dont know which webservice to retrieve

 Please help me.


REST and http services


Hi All,

Can all services that are non-SOAP, be deemed as RESTful? Where can I get some indepth information on the same?



Best way to consume REST service


I've been using 'Add Service Reference' for years now to consume SOAP based services, not because I don't understand WCF, but because I don't have time to hand-roll contracts, classes, etc everytime I want to consume something.

Now I have to consume a REST service and 'Add Service Reference' can't handle.   It looks like I'm in a position where I'm going to have to hand-roll a bunch of contracts and classes in order to consume and that just bugs me to death.

Isn't there something in VS2008/10 that does this the way 'Add Service Reference' does for SOAP services?    If not I'm very disappoint with Microsoft - Visual Studio is suppose to be about RAD - hand rolling things just to consume isn't very RAD-like.

Creating a new library using SharePoint Data Services (REST)


How can I create a new library/list using sharepoint data services (SDS)? I'd also like to add items in the newly created library programmatically using SDS? Is this possible at all?

Consume SharePoint List in Excel Services


I found some older questions regarding this but they are all listed in the Pre-SharePoint 2010 forums. I wanted to know if there is anything I can do to more easily pull data from a SharePoint List (more specifically a set of related lists) into Excel Services such that data refresh is handled as well.


I found a couple topics that used UDF as solutions to this problem, but I am not sure if they will handle data refresh. These solutions are discussed in: http://social.msdn.microsoft.com/Forums/en-US/sharepointexcel/thread/79f5c968-b68f-4d53-bfe0-d57258cfed6c and http://social.msdn.microsoft.com/Forums/en-US/sharepointexcel/thread/16f9255d-cd06-4687-ab8e-68bd6210d0f8


I am hoping the 2010 version of Excel Services can handle this more simply, thanks!

Client OM vs. Data Services (REST)

Does anyone has some guidance or recommendatory about how to decide between Client OM and Data Services (as SharePoint Data Source from VS2010) in different scenarios?
www.sharepoint-israel.co.il blog.itaysk.com
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend