private byte[] GetServiceSideErrorBody(Exception ex, bool request)
        {
            if (request)
            {
                //this can happen only with default handler on service side
                //typically when lacking access to file system
                SoapLoggerService.SetRequestException(ex);

                //in order to force HTTP 500 Internal Server Error and avoid processing
                //we overwrite request with deliberately invalid body
                return(ErrorBody.InvalidRequest());
            }

            // response
            string message = null;

            if (ex is LoggerException)
            {
                message = ex.Message;
            }
            else
            {
                message = ex.ToString();
            }

            string soapFault = ErrorBody.CreateSoapFaultResponse(message);

            byte[] errorBody = Encoding.UTF8.GetBytes(soapFault);
            return(errorBody);
        }
Beispiel #2
0
        protected override byte[] GetRequestErrorBody(Exception ex)
        {
            //this can happen only with default handler
            //typically when lacking access to file system
            SoapLoggerService.SetRequestException(ex);

            //in order to force HTTP 500 Internal Server Error and avoid processing
            //we overwrite request with deliberately invalid body
            return(ErrorBody.GetSoapInvalidRequest());
        }