I'm using wso2esb 4.7.0 and wso2dss 3.1.0.I have created restful service in wso2dss with following configuration :
<query id="selectall" useConfig="default">
<sql>select userid,username,password from usertable</sql>
<result element="Entries" rowName="Entry">
<element column="userid" name="userid" xsdType="string"/>
<element column="username" name="username" xsdType="string"/>
<element column="password" name="password" xsdType="string"/>
</result>
</query>
<resource method="GET" path="user1">
<call-query href="selectall"/>
</resource>
It's working fine in dss with below curl command
curl -X GET -H "Accept: application/json" http://192.168.1.23:9764/services/A_resttest.HTTPEndpoint/user1
Now i wish to use this service in wso2esb.How can i access this in esb.For this i have created an endpoint :
Name: resttestendp
Address: http://192.168.1.23:9764/services/A_resttest.HTTPEndpoint
Format: GET
and my esb configuration is like :
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="RESTtest"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<log level="full"/>
<send>
<endpoint key="resttestendp"/>
</send>
</inSequence>
<outSequence/>
</target>
<description/>
</proxy>
curl using to access it is:
curl -X GET -H "Accept: application/json" http://youtility-desktop:8282/services/RESTtest.HTTPEndpoint/user1
but it showing error :
ERROR - NativeWorkerPool Uncaught exception
java.lang.NullPointerException
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:156)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
Where should i make changes or i have to implement rest api concept? let me know.. I referred : Access WSO2 Data Services Service via WSO2 ESB