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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

RESTful XHTML: RESTful Services With ASP.NET MVC

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

This article describes how to use XHTML and ASP.NET MVC to implement REST services.

Aaron Skonnard

MSDN Magazine July 2009

View Complete Post

More Related Resource Links

Service Station: An Introduction To RESTful Services With WCF


We discuss some of the basic tenets of REST as well as present an implementation of a RESTful service using WCF.

Jon Flanders

MSDN Magazine January 2009

Is wsHttpBinding supports Restful services in WCF ?



One my architect in our company said that we can create Restful services using wsHttpBinding. Up to my knowledge i know only webHttpBinding is supports Restful services in WCF.

Is my architect was correct ? if yes,I need to know is any other process to make Restful services using wsHttpBinding.

Thanks in advance.........


Request Error for WCF Restful Services


I see some request error after i deployed my WCF service to my dev server.

Request Error

The server encountered an error processing the request. See server logs for more details.


This is what i used in service.svc

Factory = "System.ServiceModel.Activation.WebServiceHostFactory" but i got this request error....


The complete web.config file i've now is

<?xml version="1.0" encoding="UTF-8"?>
    <compilation debug="true">
    <serviceHostingEnvironment aspNetCompatibilityEnabled="false">
        <add prefix="http://wdev.xyz.com/Services/xxx/" />

RestFul Services for CallBack(Duplex communication)



I am able to implementing restful wcf service but now i want to use callback with it.Is it possible ?As i am getting some errors can anyone provide any Link for Restful WCF service callback.



Using RESTful Services - TeamSiteDataContext is not avaliable

I try to create a form that using REST Services to populate a sharepoint list items. I can browse the list via http://myserver/_vti_bin/ListData/mylist. I add Service Reference to my project. The ListData.svc service does find my list. However, when I show data source, I do not see the TeamSiteDataContext entity. I get an error "The type or namespace name 'TeamSiteDataContext" could not be found(are you missing a using directive or an assembly reference?)" after I enter TeamSiteDataContext mySPContext = new TeamSiteDataContext() line in my code. Is something I miss? Any help will be appreciated. Thank you.

WCF Restful Services & Net TCP binding



I have very high level knowledge of Rest. I was little confused when it came to WCF restful services. I have a service which is actaull a intranet service however it gets called from Desktop application as well as from web application. So currently we have WSHttp (for web app)& netTcp(for desktop) binding provisioned. Now if i think about makeing this service Restful will my NetTCP biding still work with this model.

Based on my understanding Rest is more toward Http Api based model so it will not help me for TCP based biding. secondly if at all i have to make this service Rstful what approach i need to follow make this service support NetTcp without code duplication.




Any one please provide sample Example for the Restful Services Using WCF interacting with Database.

Anyone please provide sample Example for the Restful Services Using  WCF interacting with Database.and the request and response formate will be in JSON.

Service Station: Building RESTful Clients


This column how to build clients applications based on the REST architecture using HTTP AP1s. The article describes how to address the question of autogenerated types and code.

Jon Flanders

MSDN Magazine October 2009

Consuming restful api (like that of basecamp from asp.net applications)

Hi How  can i Consume or use  restful api (like that of basecamp from asp.net applications)from my my .Net projects.Thanks Sagar.


Hi, how can we change the content type expected by the service operation. I am using POSt and its not working with application/text content type. Pl let me know how to post data using post method but still using application/xml content type. or is thr any way to change the content type expected by service operation to urlEncoded. Thanks in advance. Regards,chandan mahajan

RESTful WCF Workflow Service

Folks,   I'm in the middle of building a service (.xamlx) that is basically going to support a document submission workflow. Via the web service, I want clients to be able to POST a big ol' XML file into my system. This is going to kick off a big, long-running, persistable, AppFabric-managed workflow. Clients will be able to poll this (or another) service to get the status of the document processing.   My issue right now is that it appears as though, out of the box, what I get is straight-up WSDL-style services that use standard web service tactics. I was wondering if there was something I could do, either via web.config or via the workflow designer, that would allow me to have my WCF-hosted workflow AND have the endpoint be a RESTful (or even REST-ish... i'm not picky) one. In other words, I want to be able to POST an arbitrary blob of XML to my workflow service (complete with authentication tokens in custom HTTP headers). Is this possible? If so, how?The .NET Addict - http://dotnetaddict.dotnetdevelopersjournal.com

How to add XML documentation to generated Schema for a RESTful service

I'm using the RESTful Starter Kit which automatically generates a Service help page. For each method there is a link to a Request Schema. How can I add documentation/comments for each DataMember in the DataContracts so that the description/comment shows up in the generated xml schema?

Need help with Restful WCF service and tester

Greetings,  I need a simple restful service to upload an image.   I am new to restful services and this is my attempt to create a simple service and tester.  I cannot get this to work.  Like I said I am new and I would appreciate any help.  Thanks. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using System.Net; using System.ServiceModel; using System.ServiceModel.Web; namespace ImageTester { [ServiceContract] public interface IImageTestService { [OperationContract, WebInvoke(Method = "POST",UriTemplate = "File/{fileName}")] bool UploadFile(string fileName, Stream fileContents); } [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] public class ImageTestService : IImageTestService { public bool UploadFile(string fileName, Stream fileContents) { return true; } } class Program { static void Main() { Uri baseAddress = new Uri("http://localhost:8889/TestImage"); WebServiceHost host = new WebServiceHost(typeof(ImageTestService), baseAddress); try { host.Open(); Console.WriteLine(host.BaseAddresses[0].AbsoluteUri + " running.\n"); Console.WriteLine("hit a key to send image&quo

RESTful WCF with session required throws exception

Interface code:   [ServiceContract(Namespace="", SessionMode=SessionMode.Required)]   public interface ITestService   {     [WebInvoke(UriTemplate = "",         Method = "POST",         BodyStyle = WebMessageBodyStyle.WrappedRequest)]     [OperationContract]     string ModInit(String arg); ... Service code: [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] public class TestService : ITestService public string ModInit(String arg) ... Startup code: WebServiceHost host = new WebServiceHost(typeof(TestService),    new Uri("http://localhost:10000/test)); ... Client code: Uri address =  new Uri("http://localhost:10000/test"); var factory = new WebChannelFactory<ITestService>(new   WebHttpBinding { AllowCookies = true }, address); ITestService svc = factory.CreateChannel(); string resp = svc.ModInit("test"); ... This code throws a InvalidOperationException: Contract requires Session, but Binding 'WebHttpBinding' doesn't support it ... Does anyone know to get PerSession and SessionMode=SessionMode.Required working in the self hosted code above? Thanks, Mike

RESTful WCF Service endpoint not being found by client


I created a RESTful WCF service which I plan to call from a client app (a custom toolpart in a Sharepoint web part), but while I can access everything just fine from a browser the client throws this error:

EndpointNotFoundException: There was no endpoint listening at http://mymachine:3217/Services/CtmsService.svc that could accept the
message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
---> System.Net.WebException: The remote server returned an error: (404) Not Found.

My service's contract looks like this:

public interface ICtmsService
  [WebGet(UriTemplate = "/GetAllSites")]
  Dictionary<string, int?> GetAllSites();
...and the configuration looks like this: (which is more complicated due to needing dependency injection via Spring.NET to work)


Is there a way to show xHTML content in a SQL Server Reporting services?

Is there a way to show HTML content (in a table column) in a SQL Server Reporting services ?

return asp.net page contents from a restful function !


hi , 

i want to make restful function that sometime return html or javascript or anything but sets the ContentType appropriatly , thus clients processes the return contents depending on the return type.

now , i have an asp.net page , and i want to run the page internally , what ever is returned from the asp.net page (the html), i want it to sent it to the client setting it's return type to html. i am stuck at this point . i.e how do i process the asp.net page internally , get the return contents (html), and return the html from the rest ful function.



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