Search code examples
wso2-data-services-serverwso2-enterprise-integrator

ERP Operation not found error in WSO2EI DSS


I have created a REST - data service in WSO2EI an tried accessing through postman client tool, but I am getting this error.

End Point: http://LAPTOP-T4F1HOAM:8280/services/getStudRecNo?user_id=test8

The endpoint reference (EPR) for the Operation not found is /services/getStudRecNo?user_id=test8 and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator.

Can anyone please help.

Thanks

dss code.

<data name="getStudRecNo" transports="http https local">
   <description>get student unique id</description>
   <config enableOData="false" id="mySchoolDB">
      <property name="driverClassName">org.postgresql.Driver</property>
      <property name="url">jdbc:postgresql://localhost:5432/mySchool</property>
      <property name="username">admin</property>
      <property name="password">admin</property>
   </config>
   <query id="GetStudentRecordNo" useConfig="mySchoolDB">
      <sql>SELECT getstudentid FROM getstudentid(?)</sql>
      <result outputType="json">{"entries": {"entry": [ { "getstudentid": "$getstudentid"} ]}}</result>
      <param defaultValue="TEST" name="user_id" sqlType="STRING"/>
   </query>
   <operation name="getsrno">
      <call-query href="GetStudentRecordNo">
         <with-param name="user_id" query-param="user_id"/>
      </call-query>
   </operation>
   <resource method="GET" path="getsrno">
      <call-query href="GetStudentRecordNo">
         <with-param name="user_id" query-param="user_id"/>
      </call-query>
   </resource>
</data>

Solution

  • You have to append the resource path ("getsrno" in your case) to the URL. Then the URL would look like,

    http://LAPTOP-T4F1HOAM:8280/services/getStudRecNo/getsrno?user_id=test8

    Further, since the resource's HTTP method is GET, the request should also be a GET request.