Questions tagged [webinvoke]

WebInvoke - Indicates a service operation is logically an invoke operation and that it can be called by the REST programming model

48 questions
17
votes
1 answer

WCF REST Webinvoke not found

Following is the code i am using in my test app: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ServiceModel; using System.ServiceModel.Description; using System.IO; namespace MyWCFServices { …
Ankit
  • 6,388
  • 8
  • 54
  • 79
12
votes
1 answer

Get client IP address for WCF, post operation

I am trying to determine the client's IP address following this link: http://www.danrigsby.com/blog/index.php/2008/05/21/get-the-clients-address-in-wcf/ In .Net 3.0 there was not a reliable way to obtain the address of the client connecting to a…
Wayne Lo
  • 3,689
  • 2
  • 28
  • 28
9
votes
3 answers

Can't find [WebInvoke] and [WebGet]

I can't find [WebInvoke] and [WebGet]. I have already add System.ServiceModel reference. what is the problem? I use .NET Framwork 4
Darshana
  • 2,462
  • 6
  • 28
  • 54
8
votes
1 answer

How pass multiple body parameters in wcf rest using webinvoke method(Post or PUT)

I have written a REST Service in WCF in which I have created a method(PUT) to update a user. for this method I need to pass multiple body parameters [WebInvoke(Method = "PUT", UriTemplate =…
Rajesh Kumar
  • 2,443
  • 3
  • 28
  • 43
7
votes
2 answers

Accepting form fields via HTTP Post in WCF

I need to accept form data to a WCF-based service. Here's the interface: [OperationContract] [WebInvoke(UriTemplate = "lead/inff", BodyStyle = WebMessageBodyStyle.WrappedRequest)] int Inff(Stream input); Here's the implementation (sample - no…
BryanB
  • 117
  • 2
  • 3
6
votes
3 answers

WCF WebInvoke with query string parameters AND a post body

I'm fairly new to web services and especially WCF so bear with me. I'm writing an API that takes a couple of parameters like username, apikey and some options, but I also need to send it a string which can be a few thousands words, which gets…
James R
  • 651
  • 1
  • 12
  • 21
5
votes
4 answers

Passing XML string in the body of WCF REST service using WebInvoke

I'm a newbie to WCF, REST etc. I'm trying to write a service and a client. I want to pass xml as string to the service and get some response back. I am trying to pass the xml in the body to the POST method, but when I run my client, it just…
sumi
  • 53
  • 1
  • 1
  • 3
4
votes
1 answer

WCF REST WebInvoke UriTemplate & https Issue

My WCF service works with WebInvoke attributes and using httpGetEnabled. [OperationContract] [WebInvoke(Method="POST", UriTemplate = "/Function1")] void Function1(Stream input); [OperationContract] [WebInvoke(Method="POST", UriTemplate =…
Chris Klepeis
  • 9,783
  • 16
  • 83
  • 149
4
votes
2 answers

Is WebGet functionally equivalent to WebInvoke(Method = "GET")?

This question already asks what I'm asking, but I want some clarification on the answer. The answer states that WebGet and WebInvoke are similar, and that the primary difference is the Method parameter. But if the Method parameter is set to "GET",…
David says Reinstate Monica
  • 19,209
  • 22
  • 79
  • 122
4
votes
3 answers

How to call asynchronously WCF Service method with WebInvokeAttribute?

I have WCF Service with this one method. That method has WebInvoke Attribute. How can I call it asynchronously? [WebInvoke(UriTemplate = "*", Method = "*")] public Message HandleRequest() { var webContext = WebOperationContext.Current; var…
Taras Kravets
  • 1,443
  • 4
  • 14
  • 15
3
votes
0 answers

WCF REST 400 bad request on POST WebInvoke

So I have the following service: public interface IService1 { [OperationContract, WebGet(UriTemplate = "/getStuff?stuff={stuff}", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)] List getdTable(string…
Patric Cunha
  • 97
  • 1
  • 5
3
votes
2 answers

WCF Post with Query String

I am currently developing a Windows Service hosted WCF service. One of the methods has a URI which is set up to receive a callback from a payment provider. This is the interface contract... [OperationContract] [WebInvoke(UriTemplate =…
David Muir
  • 139
  • 2
  • 6
2
votes
1 answer

passing collection or array type input parameter wcf service

I have written a WCf Service which has a Collection type input body parameter and another parameter as query string as following: [WebInvoke(Method = "PUT", UriTemplate =…
Rajesh Kumar
  • 2,443
  • 3
  • 28
  • 43
2
votes
1 answer

What is the proper api url for this method?

I am consuming an api, the guy working in the backend uses c# and he could not explain to me the methods other than his code. But I don't have experience in c#. Can someone translate to me these lines and tell me what is the url part and what are…
elhoucine
  • 2,356
  • 4
  • 21
  • 37
2
votes
1 answer

Exposing selected operation contracts as ReST causing error Operation 'method name' of contract 'IContract' specifies multiple request body

Here is the scenario. There is an existing service contract with some methods which are getting consumed by a desktop app. Now need to expose some operation contracts via ReST. But it demands to expose all the methods as ReST. Else there is…
Joy George Kunjikkuru
  • 1,495
  • 13
  • 27
1
2 3 4