Stripping Illegal Characters from message Stream in Mule

I have experienced an issue where there was an illegal character in a source system which when it hit the DataWeave transformer threw an error. We have since fixed the data in the source system, however we should be able to strip this illegal character in Mule. Here is the error that occurred when it hit the DataWeave Transformer. I need help in how to and where to strip these "Illegal" characters.

ERROR 2015-11-30 17:46:16,837 [[ServiceNow].HTTP_8081_listener.worker.01] org.mule.exception.CatchMessagingExceptionStrategy: 
********************************************************************************
Message               : Illegal character ((CTRL-CHAR, code 25))
 at [row,col {unknown-source}]: [1,916] (com.ctc.wstx.exc.WstxUnexpectedCharException). Message payload is of type: WeaveMessageProcessor$WeaveOutputHandler
Type                  : org.mule.api.MessagingException
Code                  : MULE_ERROR--2
JavaDoc               : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html
Payload               : com.mulesoft.weave.mule.WeaveMessageProcessor$WeaveOutputHandler@692ffd69
********************************************************************************
Exception stack is:
1. Illegal character ((CTRL-CHAR, code 25))
 at [row,col {unknown-source}]: [1,916] (com.ctc.wstx.exc.WstxUnexpectedCharException)
  com.ctc.wstx.sr.StreamScanner:674 (null)
2. Illegal character ((CTRL-CHAR, code 25))
 at [row,col {unknown-source}]: [1,916] (com.ctc.wstx.exc.WstxUnexpectedCharException). Message payload is of type: WeaveMessageProcessor$WeaveOutputHandler (org.mule.api.MessagingException)
  org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor:32 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
********************************************************************************

Answers


The flow is expecting a valid SOAP message. If the message is invalid then what you did is the correct solution: fix the source system. Just removing characters doesn't mean the message will make sense.


Created Custom class to strip the illegal characters from the message.


Need Your Help

disable gesture control for iPad programmatically in xcode 5

ios objective-c ipad gesture

I've made an iPad game for toddlers to teach them how to move stuff around, like a drag-n-drop. The problem with children too young is that they put all their fingers on the screen which sometimes ...

IoC container resolved DbContext(EF) causing eager loadng of child object in entity

c# entity-framework ioc-container windsor-3.0

Below is the stripped down version of my original webproject. I have following classes for the Data access project