<api context="/test" name="test"> <resource faultsequence="fault" methods="POST" url-mapping="/status"> <insequence> <property expression="$body/*" name="messageBody" scope="default"> <property expression="base64Encode(get-property('messageBody'))" name="EncodeBody" scope="default"> <log level="custom"> <property expression="get-property('messageBody')" name="Request Payload"> </property></log> <enrich> <source clone="true" type="inline"></source> <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:body> <encoded xmlns=""> </encoded></soapenv:body> </soapenv:envelope> <target type="envelope"> </target></enrich> <enrich> <source clone="true" xmlns:ns="http://org.apache.synapse/xsd" xpath="get-property('EncodeBody')"></source> <target type="body"> </target></enrich> <property name="messageType" scope="axis2" type="STRING" value="application/xml"> <respond> </respond></property></property></property></property></insequence> </resource> </api>
Using a rest client post following xml content
<testencode><encode>abc</encode></testencode>
Result will be returning in following format
Result will be returning in following format
<encoded>{ENCODED_STRIN}</encoded>
This is grate. Keep it up
ReplyDelete