channelfactory

WCF Exceptions thrown by ChannelFactory

I'm connecting to a service and using a Channel created by ChannelFactory. I would like to know what exceptions can be thrown while invoking service interface's methods (for example if there is a service interface named ICalculator and I'm invoking its Add(5, 4)). I can't google the topic because i don't really know how to name the probl...

How can I read the custom HTTP status code using WCF REST?

I'm using the ChannelFactory in WCF to call into a REST service and I want to determine whether the server returned HTTP 200 or 201 in response to a PUT call. Currently, the call succeeds, but I can't determine if my object was created or updated. How can I do this? ...

ChannelFactory.Close VS IClientChannel.Close

Consider the following code which is typcial of many ChannelFactory examples: WSHttpBinding myBinding = new WSHttpBinding(); EndpointAddress myEndpoint = new EndpointAddress( ConfigurationSettings.AppSettings["HelloWorldServiceURL"]); ChannelFactory<IHelloWorldService> myChannelFactory = new ChannelFactory<IHelloWorldService>(...

ChannelFactory Reuse Strategies

I've been reading that ChannelFactory creation is expensive and that unless there is a technical reason not to, one should reuse ChannelFactories when possible either by caching them someway, or by using static instances of the factories. In your experience, what ChannelFactory reuse strategies have you found to be the most useful and r...

Handling anything other than HttpStatusCode.OK

We have written a restful service using WCF and are now trying to write FitNesse tests to verify the behaviour of this service. One test is that a 404 status code is returned if a resource can not be found. The problem is that we can not find a mechanism for consuming the service that allows us to get the status code of the incomming r...

The Address property on ChannelFactory.Endpoint was null. The ChannelFactory's Endpoint must have a valid Address specified.

Hi. I am getting the following error and I am not sure what I am doing wrong. Does anybody see anything obvious? Below are my project's Web.config and my WCF class library's App.config The Address property on ChannelFactory.Endpoint was null. The ChannelFactory's Endpoint must have a valid Address specified. APP.CONFIG ON SER...

WCF: The request for security token could not be satisfied because authentication failed.

I have two WCF services on the same machine. One is the publisher and one is the listener. The Publisher is dynamically creating proxies based upon and endpoint. I am configuring the proxy in code like this: WSHttpBinding binding = new WSHttpBinding(SecurityMode.Message, true); binding.Security.Message.Negotia...

WCF ChannelFactory vs generating proxy

Hi, Just wondering under what circumstances would you prefer to generate a proxy from a WCF service when you can just invoke calls using the ChannelFactory? This way you wont have to generate a proxy and worry about regenerating a proxy whne the server is updated? Thanks ...

WCF Consumer Website returning The Address property on ChannelFactory.Endpoint was null. The ChannelFactory's Endpoint must have a valid Address specified.

I've got a simple WCF service that works great on localhost - consumed by another local website and is returning data. Now I upload my service to our host, changing the appropriate addresses in the web.config, and it breaks when the client calls it. Error: The Address property on ChannelFactory.Endpoint was null. The ChannelFactory's...

WCF Error : Manual addressing is enabled on this factory, so all messages sent must be pre-addressed.

First off, I'd like to thank those who have helped me out with this WCF connectivity, as it's fairly new to me. I've got a hosted WCF service that I created a custom factory for, so that this would work with multiple host headers: /// <summary> /// Required for hosting where multiple host headers are present /// </summary> public class...

WCF ChannelFactory and Channel caching in ASP.NET client application

Hi All, I´m building a series of WCF Services that are going to be used by more than one application. Because of that I´m trying to define a common library to access WCF services. Knowing that each service request made by different users should use a different Channel I´m thinking in cache the Channel per-request (HttpContext.Current.I...

WCF, ChannelFactory, "Could not find endpoint element..."

I'm trying to call a WCF service from within another service, in part using an example I found here on StackOverflow which implements ChannelFactory. I've created a separate console app project within my solution for testing (VS 2008, btw), namespace MyService.Test { class Program { static void Main(string[] args) ...

WCF ChannelFactory State Property

What does it mean for a ChannelFactory to have a State property? I understand that a created channel can have connection based states. But am confused as to why the ChannelFactory also has such connection states. Does it too connect to the WCF service? ...

WCF ChannelFactory caching

I've just read this great article on WCF ChannelFactory caching by Wenlong Dong. My question is simply how can you actually prove that the ChannelFactory is in fact being cached between calls? I've followed the rules regarding the ClientBase’s constructors. We are using the following overloaded constructor on our object that inherits ...

Caching WCF Proxy?

Hi , I am trying to use Channel Factory and caching it in my asp.net mvc. I am using PerSession Instance mode as I need to know the state. Because of this I cannot close the proxy immediately. And I dont want to reopen ,close proxy everytime. If I leave the proxy open it is timing out at the 12th time. I can increase the concurrent sess...

Creating a singleton ChannelFactory<T> and reusing for client connections

In our SharePoint/ASP.NET environment we have a series of data retriever classes that all derive from a common interface. I was assigned the task of creating a data retriever that could communicate remotely with other SharePoint farms using WCF. The way I have it implemented at the moment is a singleton ChannelFactory<T> is created in a ...

WCF: Direct Channel usage vs using a Proxy?

Hello As the title implies I am trying to get an understanding of why in WCF sometimes people choose to "generate proxies" vs using a ChannelFactory to manually create new channel instances. I have seen examples of each, but haven't really found any explainations of WHY you would go for one vs the other. To be honest I have only ever w...

ChannelFactory Credentials + object is read only

Greetings, what is the problem that when I try to set credentials for my factory as follows: ChannelFactory<IWCFSeekService> factory = Factory; if (factory != null) { factory.Credentials.UserName.UserName = CServiceCredentials.Instance.Username; _Channel = factory.CreateChannel(); } I get an exception that object is read-only....

Getting error detail from WCF REST

I have a REST service consumed by a .Net WCF client. When an error is encountered the REST service returns an HTTP 400 Bad Request with the response body containing JSON serialised details. If I execute the request using Fiddler, Javascript or directly from C# I can easily access the response body when an error occurs. However, I'm us...

When should I open and close a website's cached WCF proxy?

I've browsed around the other articles on StackOverflow that relate to caching WCF proxies for reuse, and I've read this article explaining why I should explicitly open the proxy before calling anything on it. I'm still a little hazy on the best implementation details. My question is: when should I open and close proxies for service ca...