Catch Exception In Spring Web Service Interceptor and return Soap response -


Remove the details of what is the best way to catch an exception in the Spring Web Service, and this is a soap reaction? My error message description should go to the header of the soap response.

  & lt; Soapenv: envelope xmlns: soapenv = "http://schemas.xmlsoap.org/soap/envelope/" xmlns: IMS = "http://www.imsglobal.org/services/lis/cmsv1p0/wsdl11/sync/imscms_v1p" & Gt; & Lt; Soapenv: header & gt; & Lt; Imsx_syncResponseHeaderInfo xmlns = "http://www.imsglobal.org/services/lis/cmsv1p0/wsdl11/sync/imscms_v1p0" & gt; & Lt; Imsx_version & gt; V1.0 & lt; / Imsx_version & gt; & Lt; Imsx_messageIdentifier & gt; 4 & lt; / Imsx_messageIdentifier & gt; & Lt; Imsx_statusInfo & gt; & Lt; Imsx_codeMajor & gt; Failure & lt; / Imsx_codeMajor & gt; & Lt; Imsx_severity & gt; Status & lt; / Imsx_severity & gt; & Lt; Imsx_codeMinor & gt; & Lt; Imsx_codeMinorField & gt; & Lt; Imsx_codeMinorFieldName & gt; TargetEndSystem & lt; / Imsx_codeMinorFieldName & gt; & Lt; Imsx_codeMinorFieldValue & gt; Incompletedata & lt; / Imsx_codeMinorFieldValue & gt; & Lt; / Imsx_codeMinorField & gt; & Lt; / Imsx_codeMinor & gt; & Lt; / Imsx_statusInfo & gt; & Lt; / Imsx_syncResponseHeaderInfo & gt; & Lt; / Soapenv: Header & gt; & Lt; Soapenv: body / & gt; & Lt; / Soapenv: envelope & gt;    

I know this is the best way, but I have a SimpleSoapExceptionRolver Object: import java.util.Date; Import java.util.Locale; Import org.apache.log4j.Logger; Import org.springframework.ws.WebServiceMessage; Import org.springframework.ws.context.MessageContext; Import org.springframework.ws.soap.SoapBody; Import org.springframework.ws.soap.SoapFault; Import org.springframework.ws.soap.SoapMessage; Import organization Source: Public Ultimate Division Spreads MySimpleSoapExceptionResolver SimpleSoapExceptionResolver {public MySimpleSoapExceptionResolver () {super.setOrder (HIGHEST_PRECEDENCE); } @ Override protected zero customizable default (last messagecontact messageContbox_, last item endpoint_, last exception exception, SOAPFULTAL SOAPFULL_AL_) {web service message _webServiceMessageResponse = messageContext_.getResponse (); Sago Message _soapMessage = (Soap Message) _webServiceMessageResponse; SoapBody _soapBody = _soapMessage.getSoapBody (); String _message = "your error message"; Logger_logger = loggergatelogger (MySimpleSoapExceptionResolver.class); _logger.error (_message, exception_); Soapfault_ = _soapBody.addServerOrReceiverFault (_message, locale.glsh); }}

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -