Questions tagged [webchannelfactory]

12 questions
10
votes
1 answer

In WCF, for a webHttpBinding, how do I specify credentials in the client side web.config when the server is using basic authentication?

I have two WCF RESTful services - the "general" service is public and has no security; the "admin" service I intend to use basic authentication over SSL. This is my server side web.config:
7
votes
1 answer

WebChannelFactory & Headers?

Is it possible to set headers on a WebChannelFactory? If I were using a WebClient object, I could do something like this: WebClient client = new WebClient(); client.Headers.Add("referer", "http://stackoverflow.com"); client.Headers.Add("user-agent",…
Kyle
  • 17,317
  • 32
  • 140
  • 246
5
votes
1 answer

WCF Rest service error handling & WebChannelFactory

From my understanding the following should properly throw a custom error from a WCF Rest service: [DataContract(Namespace = "")] public class ErrorHandler { [DataMember] public int errorCode { get; set; } [DataMember] public string…
Kyle
  • 17,317
  • 32
  • 140
  • 246
4
votes
0 answers

Does the WCF REST WebChannelFactory client support REST services that use redirects?

If you have a RESTful web service that uses HTTP 301 redirects to send requests like: http://server/customers/?name=John to the url http://server/customers/324 (as created by a service similar to the one in this question.) Can these types of…
Jacob
  • 22,785
  • 8
  • 39
  • 55
3
votes
1 answer

WCF + REST, Increase MaxStringContentLength

We are running into the following error: There was an error deserializing the object of type Project.ModelType. The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing…
Mark Meisel
  • 851
  • 2
  • 12
  • 24
2
votes
1 answer

Disposing client after creation with WebChannelFactory

In my current production code, and according to documentation on msdn, the way to create a client is this using (WebChannelFactory cf = new WebChannelFactory("http://service.url")) { IServiceInterface…
Baptiste Pernet
  • 3,318
  • 22
  • 47
1
vote
0 answers

.net c# WebChannelFactory keepAliveEnabled=false with webHttpBehavior

I create WebChannelFactory. I need set KeepAlive=false. I found only one solution use CustomBinding. and set property keepAliveEnabled to false. I use custom behavior for my factory also. Code: static CustomBinding GetBinding(MySettings…
1
vote
1 answer

Reuse of WCF Binding class instances

I create NetTcpBinding-s on application's client side in code just after aplication started and then use it to create channel factory via new ChannelFactory(binding, address) constructor. Is it correct to pre-cache these NetTcpBinding…
Sergey
  • 161
  • 9
0
votes
1 answer

C# WCF ChannelFactory BadRequest 400 Error

I have created a simple webservice server, but to call methods from service class in same project i've created a webchannelfactory proxy. Everything it's working fine until i move the project(or exe version) to another machine. I can't figure it out…
hmiguel
  • 343
  • 1
  • 4
  • 16
0
votes
1 answer

Accessing WCF REST operation using WebChannelFactory when the operation has UriTemplate specified

I have a WCF Rest service as per the code snippet below [ServiceContract] public interface IService { [OperationContract] [WebInvoke(UriTemplate="/SaveList/Foos/",Method="POST")] bool SaveList(List myFoos); } The service…
0
votes
1 answer

Modifying the interface used for WebChannelFactory

If I have a Server/Client application that both reference the same DLL which contains interfaces used for a REST server and for the WebChannelFactory to reference the web server, what would happen to legacy clients if the Servers interface gets and…
Kyle
  • 17,317
  • 32
  • 140
  • 246
-1
votes
1 answer

Is it possible to use WebChannelFactory to make requests to WebAPI/OdataController functions/actions?

I have implemented OdataController(s) for my Web-API. Is it possible to use a ChannelFactory (or WebChannelFactory) to communicate with the Web-API, specifically i would like to call custom Functions and/or Actions. Of course, the OdataController i…