public override SoapFilter CreateServiceOutputFilter(FilterCreationContext context) { return(new DelegateFilter { ProcessEnvelope = (envelope) => { var fault = envelope.Element(NA.soap + "Body").Element(NA.soap + "Fault");; if (fault != null) { RequestResponse.DGWSServiceResponseFaultHandle11(fault, SericeUtil.ServiceSessionData.error); SericeUtil.ServiceSessionData.error = null; } var clientCard = SericeUtil.ServiceSessionData.Card; if (clientCard == null) { return SoapFilterResult.Continue; } var serviceCard = GetIDCard(clientCard.IDCardVersion); if (serviceCard != null) { serviceCard.HandleOutgoingResponse(envelope); serviceCard.HandleOutgoingMedcomHeaderResponse(envelope, GetMedcomHeader); } return SoapFilterResult.Continue; } }); }