WCF runtime error: FaultException was unhandled by user code

G

Guest

This is part of my service contract:
<OperationContract(), FaultContract(GetType(String))> _
Function AddControlStation(...) As Integer

This is part of my the service type in AddControlStation():
Throw New FaultException(New FaultReason("control station on " & port & "
already exists."), FaultCode.CreateSenderFaultCode(Nothing))

This is in my client code:

Try
Dim myControlStationID As Integer = proxy.AddControlStation(...)

Catch ex As FaultException
Console.WriteLine("FaultException: " & ex.Message)
Catch ex As CommunicationException
Console.WriteLine("CommunicationException: " & ex.Message)
Catch ex As Exception
Console.WriteLine("Exception: " & ex.Message)
Finally
.....

What is missing?

thanks herbert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top