channelfactory

Alternative to service reference

别来无恙 提交于 2020-01-13 03:44:09
问题 I am trying to assist one project team to streamline their work by fixing some of the pain points. One of the pain points they have in their code is that, they are using WCF service via service references (proxy) [i.e. "Add Service Reference" in Visua Studio 2008. This creates a lot of problem including deployment overhead, Souce Control get latest related problems of updating proxy etc. In order to handle these and other related issues with service reference, I am looking for a good

WCF ChannelFactory State Property

我的未来我决定 提交于 2019-12-21 09:18:08
问题 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? 回答1: A ChannelFactory object has a State because it is a CommunicationObject , and all CommunicationObjects in WCF have a State . Of course, that's just begging the question, and not really helpful. The real question boils down to two parts Why

Error message: The request for security token could not be satisfied because authentication failed

雨燕双飞 提交于 2019-12-11 12:16:25
问题 I am trying to access a WCF service (MS CRM 2011) and getting the above error. If I run my sample program from the VS2010 debugger with either Cassini or IIS Express it works great. No authentication errors. However, if I publish the site to my local IIS 7.5 (running Windows 7 64 bit), I get the error on the line that grabs the CRM UserId (WhoAmIResponse). I opened Fiddler to compare the requests between running under the debugger and running under IIS. On the site running under IIS the

Calling async WCF without service reference using ChannelFactory

被刻印的时光 ゝ 提交于 2019-12-10 22:21:47
问题 I'm using .NET 3.5 This is a related question but using TPL Async Library, since I'm in 3.5 I need another approach. I used to call a WCF asynchronously by adding a service reference and creating its async operations using Visual Studio 2010. Now I've created a dynamic proxy using the CreateChannel<T> of the ChannelFactory class and I need to call a method in async way. This is how I create the WCF proxy: public MyInterface Proxy { get; set; } BasicHttpBinding binding = new BasicHttpBinding()

ChannelFactory Reuse Strategies

雨燕双飞 提交于 2019-12-10 18:54:21
问题 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 robust within the context of an ASP.NET application? 回答1: If you're using .NET 3.0 SP1 and up and don't need special stuff that requires handling channels

WCF: How to diagnose faulted channels?

丶灬走出姿态 提交于 2019-12-10 17:00:55
问题 I'm working on shipping in a change for my lab that will hopefully help diagnose some weird channel-faulting weirdness we're seeing. There's a test application that uses DuplexChannelFactory to connect to a couple windows services, and for some reason the channels on this test application seem to be faulting quite a bit. I have plans to implement some retry logic in there, but it would be great to figure out why exactly they're faulting. I know that channel factories and proxy objects all

How to add async support to a .NET 4.5 WCF service so it doesn't disrupt existing clients?

雨燕双飞 提交于 2019-12-09 13:26:27
问题 I have an existing WCF service with a SOAP endpoint, using .NET 4.5. Most of the existing client code is using the ChannelFactory<T> proxy approach. I'd like to change the service to support the async / await model for various server-side I/O and database operations. The problem I'm having is that adding the async keyword to the WCF method calls requires changing their interface signatures to Task<T> . That, in turn, seems to be requiring changes to the client code. While keeping the service

When to use WCF ChannelFactory over service reference [duplicate]

我只是一个虾纸丫 提交于 2019-12-08 02:56:31
问题 This question already has answers here : WCF ChannelFactory vs generating proxy (6 answers) Closed 2 years ago . I'm going through WCF tutorials and find that these tuts point me to make a mex endpoint available to allow for implicitly adding service references to clients. I guess this allows VS to create proxy classes when consuming the resultant WSDL file? The codebase I'm trying to get comfortable on, however, does not use implicit service references. Instead clients have access to a

Getting error detail from WCF REST

て烟熏妆下的殇ゞ 提交于 2019-12-06 21:51:02
问题 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 using a WCF ChannelFactory with 6 quite complex interfaces. The exception thrown by this proxy is always a ProtocolException , with no useful details. Is there any

WCF ChannelFactory caching

蹲街弑〆低调 提交于 2019-12-06 05:35:38
问题 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 from ClientBase: ClientBase(string endpointConfigurationName, EndpointAddress remoteAddress); In the article mentioned above it is stated that: For these