Questions tagged [wcf-web-api]

The WCF Web API project allows WCF developers to expose their APIs via HTTP. Under ASP.NET MVC4, WCF Web API has become ASP.NET Web API.

The WCF Web API project focuses on allowing WCF developers to expose their APIs for programmatic access over HTTP by browsers and devices. With the release of ASP.NET MVC4, WCF Web API is now ASP.NET Web API.

Project Links:

269 questions
1
vote
1 answer

Using WebInvoke to POST data in WCF WebApi

I've recently started using WCF WebApi to create a REST api. I followed samples available on CodePlex and also articles series by Alex Zeitler. I tried to create a method which accepts data via POST as follows: [ServiceContract] public class…
Mahdi Taghizadeh
  • 903
  • 2
  • 10
  • 31
1
vote
1 answer

WCF Web API Configuration File to IIS

I have implemented a restful service with WCF Web API and I want to publish it in IIS. During developing process I was using the service as Console Application and all configuration was made through API. Now I'm trying to publish the service as…
aumanets
  • 3,703
  • 8
  • 39
  • 59
1
vote
1 answer

WCF Web services and retrieving from a database - use existing asp.net service layer?

I've just started working on a WCF services project using web.api to expose data for a mobile version of our existing asp.net mvc web application. So far I have used this WCF web.api getting started tutorial to get something running, with fake data…
Kai
  • 147
  • 1
  • 13
1
vote
3 answers

C# WCF Web API Problems Posting/Putting

I have a webservice that looks something like this: [WebInvoke(UriTemplate = "/{userName}/?key={key}&machineName={machineName}", Method = "PUT")] public HttpResponseMessage PutSomeStuff(string userName, string key, string…
Luke Belbina
  • 5,708
  • 12
  • 52
  • 75
1
vote
1 answer

C# Wcf Web API Deserializing Response

I am trying to unit test a web service that returns a non primitive. The response can be either xml or json depending on the request. In my test it'd be great if I could deserialize the content body to one of my objects. Here's some code: …
Luke Belbina
  • 5,708
  • 12
  • 52
  • 75
1
vote
1 answer

Wcf Web API Sandbox Endpoint Handling

I have an api which will be publicly exposed and have a sandbox. I've written some code in my ResourceFactory so api.sandbox.whatever/whatever will work and also sandbox=true in the arguments will work but this feels like a giant hack. Any better…
Luke Belbina
  • 5,708
  • 12
  • 52
  • 75
1
vote
1 answer

WCF Web API Host Project Type

I am used to creating traditional WCF services and hosting them in IIS. I do this by creating a WCF Service Application within Visual Studio. For my next project I want to leverage the functionality found in the new WCF Web API. However I am not…
Cragly
  • 3,554
  • 9
  • 45
  • 59
1
vote
3 answers

How to add xml prefix using XDocument?

How do I add xml prefixes using XDocument to an existing root element? I have the following XML:
and I want it to look like:
satish
  • 31
  • 6
1
vote
2 answers

QueryInterceptor similar thing in Web API

I'm actually migrating some parts of my previous WCF services to Web API. I had used QueryInterceptor on my Machine entity which checks whether the current user has access to the desired data and returns all the data or a filtered set that they…
Nameless
  • 1,026
  • 15
  • 28
1
vote
1 answer

portType is coming null in wsdl parsing

I am in the middle implementation small program of WSDL parser. But I am getting ptobject is coming NULL. This is happening with the wsdl mentioned in the program. I don't think WSDL is wrong because if give the same WSDL to SOAP UI it is parsing…
user2329702
  • 479
  • 1
  • 4
  • 12
1
vote
0 answers

WCF calling Third party Web Service

I have a workflow of a payment within a third party. Because in POS we don't have a way so that the third party could send the response after the user paid in is phone I thought that I could act in the middle of the POS and the third party (red…
1
vote
1 answer

user agent value in IIS and my Log file is diffrent

I want to log the user agents information in my log file. So I used this code: System.Web.HttpContext.Current.Request.UserAgent; It works fine, when I'm using the browser to consume my web service (the user agent returns the right value) but…
Mohammad
  • 2,724
  • 6
  • 29
  • 55
1
vote
1 answer

how to create header/body validation filters in c# webapi

I am passed the request with post method. I want to validate the request(header/body) using filters. how I can configure the thing using Web api. below are my request : x-ln-request:
kiriti
  • 35
  • 2
  • 7
1
vote
1 answer

Query Service PositionBasedPaging doesn't work in MVC WebAPI

I want to get records by using paging from Query Service of Dynamics AX 2012 through MVC WebAPI. When I run this code in Console Application works fine. QueryServiceClient client = new QueryServiceClient(); DataSet dataSet; …
1
vote
0 answers

dropping characters when passing json to webapi method

I'm attempting to pass a string to a web api method. The string on the client side looks like this: "shipment id :{{{shipmentId}}}", but at the server, the {{{shipmentId}}} is being dropped and the web api method on the server only sees "shipment…
user1202839
  • 365
  • 1
  • 5
  • 18