I am following the labkit of the WSO2 Enterprise Integrator Developer Advanced course: https://wso2.com/training/enterprise-integrator-developer-advanced#request_training_enroll
and I have a doubt about the different between the concept of API and PROXY.
In this labkit there is an example related how to build a custom connector (the question is not strictly related to the connector topic).
In the example it first create and deploy a custom connector, then create and use this custom connector into this proxy:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="googlebooks_listVolume"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<property name="searchQuery"
expression="json-eval($.searchQuery)"/>
<googlebooks.listVolume>
<searchQuery>{$ctx:searchQuery}</searchQuery>
</googlebooks.listVolume>
<respond/>
</inSequence>
<outSequence>
<log/>
<send/>
</outSequence>
</target>
<description/>
</proxy>
It worked fine and my connector is correctly called. But I am asking what is the exact difference between a PROXY like this and an API.
I read this: Difference between Proxy Service and API Service in wso2 Esb
Ok...using the API I can define multiple resources performing different CRUD operation while with a proxy I have a single entry point. The fact is that given this, there seems to be only one difference in comfort:
I need multiple CRUD operation? I implement an API. I need a single isolated operation? I implement a proxy.
But I think that there must also be other...
I know that APIs are based on REST concept. I also read that proxy is used to expose SOAP web service.
This last assertion is not so clear for me. To call the previous PROXY (implementing something like a WS) I do:
curl -v -X POST -d "{"searchQuery":"rabbit"}" -H "Content-Type: application/json" http://localhost:8280//services/googlebooks_listVolume
So it seems not to me a SOAP request because I am passing a JSON object containing my parameter that is used by this web service.
This is also not a pure REST web service, but I think that definitively it is not a SOAP service (that from what I know use a WSDL XML message.
So, what am I missing?