User Tools

Site Tools


wso2

WSO2 API Manager

API Manager with Analytics - There was a backup task (snapshot) at 23h GMT.

WSO2 Enterprise Integrator

Put *.jar JDBC drivers to

\lib

Endpoint host name is shown as 'null' in service dashboard
– make sure that hostname is properly set!

Database connection

Put *.jar JDBC drivers to

\repository\components\lib

Connect MariaDB JDBC Driver (different from MySQL template)

WSO2 Data Services Server

Connect to PostgreSQL DB and create REST API XML / JSON

<data name="sde" transports="http https">
   <config id="sde">
      <property name="driverClassName">org.postgresql.Driver</property>
      <property name="url">jdbc:postgresql://10.160.150.86:5432/sde</property>
      <property name="username"></property>
      <property name="password"></property>
   </config>
   <query id="tabory" useConfig="sde">
      <sql>select nazev,jtskx,jtsky from tabory</sql>
      <result element="tabory" rowName="nazev">
         <element column="nazev" name="nazev" xsdType="string"/>
         <element column="jtskx" name="jtskx" xsdType="string"/>
         <element column="jtsky" name="jtsky" xsdType="string"/>
      </result>
   </query>
   <operation name="operation">
      <call-query href="tabory"/>
   </operation>
   <resource method="GET" path="tabory">
      <call-query href="tabory"/>
   </resource>
</data>
<data name="getCHTS" transports="http">
   <config enableOData="false" id="rcs">
      <property name="driverClassName">oracle.jdbc.driver.OracleDriver</property>
      <property name="url">jdbc:oracle:thin:@IP:1521/orcl</property>
      <property name="username"></property>
      <property name="password"></property>
   </config>
   <query id="query" useConfig="rcs">
   <sql>SELECT K_VP_CHTS, N_VP_CHTS, VYROBCE_TYP, I_VP_CHTS, USER_KEY,(SELECT VYR_CISLO FROM VP_CHTS_DSP WHERE VP_CHTS_DSP.K_VP_CHTS = VP_CHTS.K_VP_CHTS) AS VYR_CISLO FROM VP_CHTS WHERE (KC_TPO = 501141 OR KC_TPO = 501145 OR KC_TPO = 501144) AND X_VP_CHTS = 1</sql>
         <result element="list" rowName="Lahev">
         <element column="K_VP_CHTS" name="CHTS_K" xsdType="string"/>
         <element column="N_VP_CHTS" name="CHTS_NAME" xsdType="string"/>
         <element column="VYROBCE_TYP" name="CHTS_TYPE" xsdType="string"/>
         <element column="I_VP_CHTS" name="CHTS_INFO" xsdType="string"/>
         <element column="VYR_CISLO" name="CHTS_VYRCISLO" xsdType="string"/>
         <element column="USER_KEY" name="CHTS_USERKEY" xsdType="string"/>
      </result>
   </query>
   <operation name="get">
      <call-query href="query"/>
   </operation>
   <resource method="GET" path="/">
      <call-query href="query"/>
   </resource>
</data>

json →

<query id='sample' useConfig='default'>
<sql>select * from Employees where id = ?</sql>
<result outputType='json'>
{ "employees":{
   "employee":[
               {
               "lastName":"$lastname",
               "firstName":"$firstname",
               }
              ]
             }
}
</result>
<param name='id' ordinal='1' sqlType="INTEGER"/>
</query>

Redirected to localhost?

carbon.xml file under /repository/conf folder.
Change <HostName>localhost</HostName> to your IP.
wso2.txt · Last modified: 2017/07/10 10:01 by Jan Forman