I\'m attempting to retrieve data from Facebook using the WSO2 Facebook Connector in WSO2 ESB 4.9.0. I\'ve provided the proxy configuration below.
Many thanks @RavindraRanwala and @ThusithaThilinaDayaratne for leading me to the resolution of this issue.
After consulting the wire logs, it appears the Facebook API is responding with text/javascript content type. I had no message builder/formatter enabled within the ESB to handle this content type, so the process ended up failing. All I needed to do was open up my axis2.xml configuration file and append the following message builders:
<!--JSON Message Builders-->
<messageBuilder contentType="application/json" class="org.apache.synapse.commons.json.JsonStreamBuilder"/>
<messageBuilder contentType="text/javascript" class="org.apache.synapse.commons.json.JsonStreamBuilder"/>
... and formatters:
<!--JSON Message Formatters-->
<messageFormatter contentType="application/json" class="org.apache.synapse.commons.json.JsonStreamFormatter"/>
<messageFormatter contentType="text/javascript" class="org.apache.synapse.commons.json.JsonStreamFormatter"/>
The most up to date documentation on the Facebook connector seems to be at the GitHub page, where all the necessary builder/formatter information is clarified:
https://github.com/wso2/esb-connectors/tree/master/facebook/facebook-connector/facebook-connector-1.0.0