wcf-client

WCF TCP clients - basic guidelines on how to use them?

空扰寡人 提交于 2020-02-26 08:18:43
问题 I've got a WCF service and want to connect to it using a TCP binding. This is all well and good, but how are you supposed to handle the clients? I've noticed that if you create a new client for each call it doesn't re-use the channel and leaves around a bunch of TCP connections until they time out. Is it normal use to create a client, call a method on it, then close it? What if you want to re-use the connection? What are the limitations on that? Can you make simultaneous calls from different

Client timeout when using WCF through Spring.net

守給你的承諾、 提交于 2020-01-25 09:22:05
问题 I'm using WCF through Spring.net WCF integration link text This works relatively fine, however it seems that WCF and Spring get in each other's way when instantiating client channels. This means that only a single client channel is created for a service and therefore the clients get a timeout after the configured timeout is expired since the same client channel has been open since it was instantiated by Spring. To make the matters worst, once a channel goes to a fault state, it affect all

How do I use WCF reference with MVC3 (razor) model?

微笑、不失礼 提交于 2020-01-23 12:06:28
问题 I have a WCF Service and a MVC3 (razor) web site. All my data comes from the WCF Service . I have my controllers and views but, how do I use the model with this structure ? for now, I call my method from the service with a DataController and I called them in the Controllers.. Better solution ? 回答1: Do you want to access a WCF service from your Model? Ouch... Stick to the Controller. Controllers interact with services, models don't. 回答2: 1.You created web reference to your service - and

How do I use WCF reference with MVC3 (razor) model?

依然范特西╮ 提交于 2020-01-23 12:05:47
问题 I have a WCF Service and a MVC3 (razor) web site. All my data comes from the WCF Service . I have my controllers and views but, how do I use the model with this structure ? for now, I call my method from the service with a DataController and I called them in the Controllers.. Better solution ? 回答1: Do you want to access a WCF service from your Model? Ouch... Stick to the Controller. Controllers interact with services, models don't. 回答2: 1.You created web reference to your service - and

WCF Timeout issue?

狂风中的少年 提交于 2020-01-21 03:32:08
问题 I have a somewhat long-taking WCF-based process. WCF service runs in Azure if its of any help. The issue I believe has to do with timeouts: 1) Winforms client has the following .config setting in the binding section: <wsHttpBinding> <binding name="XXX" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="10000000" maxReceivedMessageSize=

Can I differentiate a timeout from a message size issue using only CommunicationException?

若如初见. 提交于 2020-01-17 11:11:11
问题 Folks, I hit the following exception and I know for a fact that its not a timeout issue and that its a message size issue. Using ONLY the CommunicationException, is there a way to tell that this issue was a message size issue and not a timeout issue? Perhaps one of the properties on CommunicationException? or maybe it can be cast in a certain way? I'm willing to explore any proposals. System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an

Adding an outgoing message headers in WCF can't be retrieved in incoming message headers

孤街醉人 提交于 2020-01-16 16:58:45
问题 I am using WCF Services for my application. I've got three functions - Add, GetList, GetSingle. To create the service on the client-side, I am using this code: Public Shared Function GetService(ByRef oScope As OperationContextScope) As XService.XServiceClient Dim oService As New XService.XServiceClient oScope = New OperationContextScope(oService.InnerChannel) oService.Open() Dim oMessageHeader As System.ServiceModel.Channels.MessageHeader = MessageHeader.CreateHeader("SecurityContext", String

Adding an outgoing message headers in WCF can't be retrieved in incoming message headers

放肆的年华 提交于 2020-01-16 16:58:36
问题 I am using WCF Services for my application. I've got three functions - Add, GetList, GetSingle. To create the service on the client-side, I am using this code: Public Shared Function GetService(ByRef oScope As OperationContextScope) As XService.XServiceClient Dim oService As New XService.XServiceClient oScope = New OperationContextScope(oService.InnerChannel) oService.Open() Dim oMessageHeader As System.ServiceModel.Channels.MessageHeader = MessageHeader.CreateHeader("SecurityContext", String