From API Manager 1.3.0 onward we will be using pass-through transport inside API Manager. Normally in passthrough we do not build message body. When we use pass-through you need to build message inside handler to access message body. But please note that this is bit costly operations when we compare it with the default mediation. Actually we introduced pass-through transport to improve performance of gateway. There we do not build or touch message body. Add followings to your handler to see message body.
Add following dependency to your handler implementation project
<dependency>
<groupId>org.apache.synapse</groupId>
<artifactId>synapse-nhttp-transport</artifactId>
<version>2.1.2-wso2v5</version>
</dependency>
Then import RelayUtils to handler as follows.
import org.apache.synapse.transport.passthru.util.RelayUtils;
Then build message before process message body as follows(add try catch blocks when needed).
RelayUtils.buildMessage(((Axis2MessageContext)messageContext).getAxis2MessageContext());
Then you will be able to access message body as follows.
<soapenv:Body><test>sanjeewa</test></soapenv:Body>
No comments:
Post a Comment