HTTP 404 Error manifests itself as EndPointNotFoundException on a WCF client

Posted by dudia on Stack Overflow See other posts from Stack Overflow or by dudia
Published on 2010-05-19T19:02:35Z Indexed on 2010/05/20 9:30 UTC
Read the original article Hit count: 543

Filed under:
|

How can I make my client treat 404 Error correctly? Right now it catches a general exception...

My WCF Server uses WebOperationContext.Current.OutgoingResponse.SetStatusAsNotFound(); To return a 404 Error code

however my WCF client interperts it as an EndPointNotFoundException

There was no endpoint listening at http://myUrl that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

The inner exception is WebException "The remote server returned an error: (404) Not Found.

© Stack Overflow or respective owner

Related posts about wcf

Related posts about http-status-code-404