Using vs2008, vb.net, C #, fw 3.5
I use the service in my client
Service hosted in IIS
Client (winforms MDI) is generated using svcutil using the / l, / r, / ct and / n switches
Service and client use MyEntities.dll
I use nettcp with TransportWithMessageCredential I cache proxies in the main form
if Membership.ValidateUser(UsernameTextBox.Text, PasswordTextBox.Text) _proxy = new MyServiceClient _proxy.ClientCredentials.UserName.UserName = "username" _proxy.ClientCredentials.UserName.Password = "password"
Then I pass _proxy to all child forms / plugins that should use them ex
List(of Orders) = _proxy.ChannelFactory.CreateChannel.GetOrders(customer)
Everything works fine, but my questions are:
What happens to channels after a call? Are they magically tuned?
How can I control this with the profiler?
Is there a way I can handle errors in one place, or do I need to place try / catch in all calls, such as What is the best workaround for WCF client `block issue?
try { ... client.Close(); } catch (CommunicationException e) { ... client.Abort(); } catch (TimeoutException e) { ... client.Abort(); } catch (Exception e) { ... client.Abort(); throw; }
Can I sign up for _proxy.InnerChannel.Faulted and do it there?
Hi
_Eric