[SWS-671] Stacktrace in response instead of soap fault Created: 17/Dec/10  Updated: 18/Mar/14  Resolved: 18/Mar/14

Status: Resolved
Project: Spring Web Services
Component/s: Core
Affects Version/s: 1.5.9
Fix Version/s: 2.0.4

Type: Bug Priority: Major
Reporter: Martin Flower Assignee: Arjen Poutsma
Resolution: Complete Votes: 6
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SWS-688 Unable to handle Exception when endpo... Resolved
Reference URL: http://forum.springsource.org/showthread.php?t=93626

 Description   

The webservice responds with a stacktrace instead of a soap fault if malformed xml is sent.



 Comments   
Comment by Justin Boyd [ 20/Dec/10 ]

We currently have SOAP services in production that still provide a stack-trace when malformed XML is sent to them - this is a very difficult bug to deal with and there is currently no work-around

Comment by john bush [ 03/Feb/11 ]

This ruined a better part of my day. The endpoint resolvers are pretty useless. This really needs to be fixed. I had to extend the servlet to get around this, feels totally hacky, but can't sort out any other way.

Comment by Ted Pennings [ 18/May/11 ]

John, not sure if it's too late to help, but you could create a servlet filter and wrap the chain.doFilter() method in a try-catch block for NestedServletException. You can look at the cause to see if it's an invalid XML related issue, and take action that way. It's slightly better than having to extend the MessageDispatcherServlet, but really not by much. It would be nice to see this issue resolved.

Comment by Jarkko Rantavuori [ 26/Sep/13 ]

What I have done is to define a custom MessageReceiverHandlerAdapter that is used by the default spring-ws MessageDispatcherServlet. That works and I think is the way to handle this by design. I can provide the code if needed.

Comment by Arjen Poutsma [ 18/Mar/14 ]

As of version, Spring-WS throws a InvalidXmlException when dealing with invalid XML. By default, this exception results in a 400 status code, but it can be changed by overriding WebServiceMessageReceiverHandlerAdapter.handleInvalidXmlException,

Generated at Fri Dec 15 17:51:59 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.