I have created an API which return HTLM response , i would like to save the response data into a property in WSO2 Integration Studio . I used this configuration but it didn't work.
<resource methods="GET" uri-template="/currentsession">
<inSequence>
<call>
<endpoint>
<http method="get" uri-template="http://**************************">
<suspendOnFailure>
<initialDuration>-1</initialDuration>
<progressionFactor>-1</progressionFactor>
<maximumDuration>0</maximumDuration>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>0</retriesBeforeSuspension>
</markForSuspension>
<authentication>
<basicAuth>
<username>test</username>
<password>test</password>
</basicAuth>
</authentication>
</http>
</endpoint>
</call>
<property name="response" scope="default" type="STRING" expression="$ctx:ORIGINAL_MESSAGE"/>
<log>
<property expression="get-property('response')" name="tt"/>
</log>
<respond/>
</inSequence>
<outSequence/>
<faultSequence/>
</resource>
How to handle this issue .
Did you mean to do the below? I don't see you have assigned a value to ORIGINAL_MESSAGE
.
<property name="response" scope="default" type="STRING" expression="$body"/>
<log>
<property expression="get-property('response')" name="tt"/>
</log>
Update
Add the following to the deployment.toml
. Make sure the content_type
is the same as the Content-Type header that comes in the response.
[[custom_message_builders]]
class = "org.apache.axis2.format.PlainTextBuilder"
content_type = "text/html"