Questions tagged [webget]

45 questions
2
votes
2 answers

Passing network path in URL

I am creating a WCF Service with a method [OperationContract] [WebGet(UriTemplate = "acl/f={fullFileName}")] string GetACL(string fullFileName); fullFileName is a full path to a network file, or a file on the host. The host is a Windows Service…
Beezler
  • 23
  • 1
  • 3
2
votes
2 answers

WCF WebGet and ICollection<>

I'm attempting to return a generic ICollection from a REST WCF service. Should the following be possible? [ServiceContract] public class WebConfigurationManager { [WebGet] [OperationContract] public ICollection GetStrings() { …
GuyBehindtheGuy
  • 1,368
  • 2
  • 17
  • 36
1
vote
1 answer

Force HTTPS(SSL) on a WCF WebGet method

I have a method like this: [WebGet(UriTemplate = "/")] [OperationContract] public XmlElement All() {} Is there a way to force clients to always use HTTPS? (deny HTTP and allow only HTTPS)? If yes, how? Thank you
1
vote
1 answer

How to run WCF service method with WebGet attribute on the root of the host

I do have this WCF service contract: [ServiceContract] public interface IPolicyRetriever { [OperationContract, WebGet(UriTemplate = "/clientaccesspolicy.xml")] Stream GetSilverlightPolicy(); } with this Web.config section:
Michele Di Cosmo
  • 491
  • 1
  • 5
  • 18
1
vote
0 answers

400 Bad Request Response from long URI in GET HttpWebRequest (>2048 bytes)

After receiving 404 Not Found errors when trying to send more than 2048 bytes of data, I found this page and changed the RequestLimits in IIS to allow more than 2048 (currently set to 8192 to try it out). IIS subsequently added the maxURL and…
Vulture
  • 11
  • 2
1
vote
2 answers

WCF Method that receive GET AND SOAP Requests

i created a WCf service with a method that can receive GET requests using WebGET attribute, i want the same method to receive Soap calls too (that when the programmer does a Service reference to the WCF, he will be able to call the method). my…
Rodniko
  • 4,926
  • 20
  • 69
  • 93
1
vote
1 answer

WCF RequestFormat for WebGet and WebInvoke

I have WCF services exposed using WebGet and WebInvoke that require the data to be wrapped in xml. I would prefer to be able to return raw data without it being wrapped in xml and also allow clients the ability to invoke my service without needing…
Sean
  • 2,453
  • 6
  • 41
  • 53
1
vote
4 answers

REST methods not accessible when hosting wcf service in IIS

I have a WCF REST service that exposes a method in class GreetService: [ServiceContract] public class GreetService { [WebGet(UriTemplate = "greet/{name}")] public String GreetName(string name) { return "Hello " + name; …
Masterfu
  • 1,191
  • 3
  • 14
  • 26
1
vote
1 answer

WCF and using WEBGET to test service in browser

Hi I am very new to using WCF (half a day old) and I have created a service which I can see via localhost http://localhost:[port]/Service1.svc? - no 404! However, before I want to connect to this service via an application, I want to see if the…
user3428422
  • 4,300
  • 12
  • 55
  • 119
1
vote
1 answer

Method to return JSON without { "d: " element

I currently have a WebGet method that returns JSON correctly with the nested { d: } element, is there a way to remove this? Here is my Server Side Code and my class defining the JSON return: [OperationContract, WebGet(ResponseFormat =…
Jacques Bronkhorst
  • 1,685
  • 6
  • 34
  • 64
1
vote
1 answer

Using WCF Data Services (ODATA) operations in Windows Phone development

I'm developing a windows phone application that needs to consume data from an OData feed (using WCF Data Services). Specifically, I need to call the following…
MvdV
  • 55
  • 1
  • 5
1
vote
1 answer

Invoke a Operation Contract through web browser

Since i am new to WCF and Having configured a WCF service endpoint in IIS at Virtual Directory Api ( url goes like http://localhost/api/taskapi.svc) i was looking for ways to make request through web browser something like…
Deeptechtons
  • 10,945
  • 27
  • 96
  • 178
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
2 answers

WebGetAttribute what should I reference

I'm building a WCF WindowsService in .NET 4.0. I'd like to make it RESTfull and change the response and request type to JSON. To do that I need to use the WebGetAttribute under the OperationContract in the interface. But I can't find the…
Patrice Cote
  • 3,572
  • 12
  • 43
  • 72
0
votes
1 answer

WCF: Multiple optional parameters in UriTemplate

The UriTemplate of my Service looks like this: [WebGet(UriTemplate = "LoginUser/authorizationCode/{authorizationCode}/userId/{userId}/intend/{intend}/email/{email}")] The function looks like this: public User LoginUser(string authorizationCode,…
k.troy2012
  • 344
  • 4
  • 21