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
1
vote
1 answer

Change in UriTemplate on WCF interface causes whole service to fail.

This is my first attempt at a service via WCF which is hosted in a Windows Service. I have noticed that if I do something incorrectly in the UriTemplate it completely breaks everything and I don't know why. Example: In the first code example…
CathalMF
  • 9,705
  • 6
  • 70
  • 106
1
vote
3 answers

calling RESTful WCFservice method with object as parameter from java

i have a RESTful WCF service and one of its methods use an Object as parameter [WebInvoke(UriTemplate = "save", Method = "POST", RequestFormat = WebMessageFormat.Xml, ResponseFormat= WebMessageFormat.Xml), OperationContract] public…
0
votes
1 answer

ChannelFactory with WebHttpBinding always POSTs while executing a ServiceContract OperationContract

I have a service that is hosted via WebServiceHost and I need to delegate some of the calls to other REST services on the web. I built a ClientBase concrete class to handle this. The flow looks like this: http://localhost:8000/users/my@email.com ->…
0
votes
1 answer

How to define attributes to upload data to a REST web service implemented through a WCF service?

I created a WCF service, that returns some data and also allow to post some data to. The methods of the service are as below: [OperationContract] bool UploadStream(Guid key, List values); [OperationContract] bool…
bzamfir
  • 4,698
  • 10
  • 54
  • 89
0
votes
1 answer

accessing WebInvoke UriTemplate in WCF, I need the template string

I have in WCF [WebInvoke(UriTemplate = "etcetc" I need to access the string "etcetc" for use in some of my business logic, not sure if this is possible or not? Where is it stored in memory?
Devin Andres Salemi
  • 2,198
  • 3
  • 12
  • 25
0
votes
1 answer

C# RESTful service - HTTP 504 / Connection Reset

I have a C# application that takes and returns information via RESTful services. The way I handled these operations before, was the methods simply returned JSON strings, and these strings were then wrapped in XML. To prevent this, I changed the…
SimonC
  • 1,547
  • 1
  • 19
  • 43
0
votes
1 answer

How to do ad-hoc testing of web service PUT methods?

I've written a web service and it's nice that you can just navigate to http://whatever... and see the response to GETs. Is there some nifty way I can do something similar for PUTs? (presumably involving some tool to write the info that's PUTed).…
Rory
  • 40,559
  • 52
  • 175
  • 261
0
votes
1 answer

WCF WebInvoke POST message body

[OperationContract] [WebInvoke(UriTemplate = "s={s}", Method = "POST")] string EchoWithPost(string s); I'm trying to consume this method (WCF service) using a WebRequest: WebRequest request1 = WebRequest.Create("http://MyIP/Host"); request1.Method…
user2179256
  • 659
  • 2
  • 9
  • 21
0
votes
0 answers

JQUERY AJAX POST to WCF Service

I am trying to get the data from the Web Service by using the POST Method. This is my javascript to get the data var s = { OpportunityID: 6 } $.ajax({ type:…
TTCG
  • 8,805
  • 31
  • 93
  • 141
0
votes
1 answer

Could not invoke WebInvoke method with parameter

[ServiceContract] public interface IMyService { [OperationContract] [WebGet(UriTemplate = "/v1/getCustomBodyTypes", ResponseFormat = WebMessageFormat.Json)] [JSONPBehavior(callback = "callback")] List
Jin Ho
  • 3,565
  • 5
  • 23
  • 25
0
votes
1 answer

HTTP 400 Bad Request - CORS enabled WCF Service

I am trying to use CORS on WCF for cross domain calls to the service. I have most of the things working, but when I try to call the function it always gives me a error -HTTP 400 Bad Request I used Fiddler to capture the error and it says something…
Ron
  • 886
  • 13
  • 39
0
votes
0 answers

C# Restful Service Using WebInvoke POST method

My service is working well when i use: [OperationContract] [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "json/?id={id}")] string jdata(string id); and my Method…
SHAKEEL
  • 11
  • 2
  • 3
  • 9
0
votes
0 answers

How to return valid JSON array in WCF

Here is my webInvoke [WebInvoke( Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "{invoice}/{transtype}/" ) ] I have this return…
SHINHAN
  • 685
  • 2
  • 12
  • 28
0
votes
0 answers

Why WCF service is getting old values of parameters

I have setup two projects. One is WCF service project with following contract: [OperationContract] [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Bare, UriTemplate =…
0
votes
1 answer

WebInvoke Parameter is NULL

I have a service where the operation contract looks like the following. I have a WebInvoke attribute and the method is set to POST. I do have a UriTemplate. The actual service method name is SaveUser. I am trying to pass in a User object (a data…