how do i add IncludeExceptionDetailInFaults = true; to the below code. I need to get the details of the FaultException thrown by the web service. currently i am not getting any details back. It looks like the only thing i get back is the . any ideas?
c# code
CustomBinding Binding = new CustomBinding(BINDING_NAME);
EndpointAddress EndPoint = new EndpointAddress(WsEndpoint);
// Trust all certificates
ServicePointManager.ServerCertificateValidationCallback = ((Sender, certificate, chain, sslPolicyErrors) => true);
_WsProxy = new MyDataSoapClient(Binding, EndPoint);
//_WsProxy.Endpoint.Behaviors.Add(????);
_WsProxy.ChannelFactory.Credentials.UserName.UserName = "username";
_WsProxy.ChannelFactory.Credentials.UserName.Password = "pwd";
I think you'll have to add a ServiceDebugBehavior.
ServiceHost host = new ServiceHost(typeof(MyService), new Uri("http://localhost:6598/"));
host.AddServiceEndpoint(typeof(IMyService), new BasicHttpBinding(), "MyService");
host.Description.Behaviors.Remove(typeof(ServiceDebugBehavior));
host.Description.Behaviors.Add(new ServiceDebugBehavior() { IncludeExceptionDetailInFaults = true });
host.Open();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With