Reputation: 415
I am spending a lot time to understand how to convert a bufferInput stream or Dataweaveoutputhandler to other datatypes such as string or object or xml
I am constantly getting this type of error whenever I changed expression
Execution of the expression "xpath3('/*',payload,'NODESET')" failed. (org.mule.api.expression.ExpressionRuntimeException). Message payload is of type: BufferInputStream (org.mule.api.transformer.TransformerMessagingException). Message payload is of type: BufferInputStream Please help me to know if anyone has solved this issue.
Upvotes: 0
Views: 115
Reputation: 175
Apache provide us with great library to convert between various datatypes.
http://axis.apache.org/axis2/java/core/apidocs/org/apache/axis2/databinding/utils/ConverterUtil.html#convertToDataHandler(java.lang.String)
kindly go with this.
Thanks!
Upvotes: 0
Reputation: 66
Exception is thrown by wrong xpath3 expression, not wrong payload type. You use xpath3 in splitter? Paste some xml, below working xpath3 expression example.
<splitter expression="#[xpath3('//YOUR_NODENAME',payload, 'NODESET')]" doc:name="Splitter"/>
If you want to log payload just try:
<logger message="Response := #[message.payloadAs(java.lang.String)]" level="INFO" doc:name="Logger"/>
Upvotes: 1