Joe Murphy
Joe Murphy

Reputation: 1

WCF Custom FaultException thrown but ProtocolException Recived by Client

I have a WCF service that is coded to throw a Custom FaultException under certain conditions. When hosted locally and on several servers this executes as excpected, Custom fault thrown by service custom fault caught by client, but on production and UAT server the Custom fault is thrown by what the client recieves is a Protocol Exception (500 error).

Is anyone aware of an IIS or sever setting that could be effecting this WCF server? This issue is driving me crazy

Upvotes: 0

Views: 780

Answers (1)

Doron
Doron

Reputation: 41

I am having a similar Issue,

our server is using a third party web service, when a client connects to our server from the same machine, our server can catch the Fault Exception, but if the client is connecting over the network our server can't handle the Fault Exception, and is only getting the "500 Internal Server Error".

I used a sniffer to see the incoming data, and I can see that the webservice is sending the Fault Exception in both cases, this is a third party webservice so i have no control over it.

the clients use .Net Remotting to connect to the server.

The Solution:

add RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off; to the Remoting server, for some reason it is affecting the Exceptions it (the server) is receiving. this is not the ideal solution because now we are exposing our servers Exceptions ...

Upvotes: 0

Related Questions