How do you catch/access the info within the soapenv:Detail node when a WCF service call returns an error??
Catching the FaultException alone does not include it bu I can see the data in the service trace log.
Solution/Workaround:
Catch ex As FaultException
Dim detailsMsg As String = String.Empty
Dim mf As MessageFault = ex.CreateMessageFault
If mf.HasDetail Then
Dim ns As XNamespace = "http://url"
Dim detailedMessage As XElement = mf.GetDetail(Of XElement)()
Dim messageElement As XElement = detailedMessage.Descendants(ns + "Message").SingleOrDefault
If messageElement IsNot Nothing Then
detailsMsg = messageElement.Value
End If
End If
End Try
Still can't catch with:
Catch ex As FaultException(Of XElement)
Which would have been nice...