Question

I am working on sample application in WSO2 esb which connects to Oracle Database and return the response of a query. Below mentioned is my service. Issue I am facing is I am not getting the response back after execution of service.However I am able to see the value returned as a query response, but not able to render it in response document.

Can anybody suggest, what I am missing? DB credentials fields have been hashed.

Proxy :

<?xml version="1.0" encoding="UTF-8"?>

<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="getEmployeeDetails"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence>
         <property name="OUT_ONLY" value="true" scope="default" type="BOOLEAN"/>
         <log level="full" category="DEBUG"/>
         <dblookup>
            <connection>
               <pool>
                  <password>****</password>
                  <user>****</user>
                  <url>****</url>
                  <driver>oracle.jdbc.xa.client.OracleXADataSource</driver>
               </pool>
            </connection>
            <statement>
               <sql>select firstname from employee where lastname = 'pawar'</sql>
               <result name="firstname" column="firstname"/>
            </statement>
         </dblookup>
         <log level="custom">
            <property name="firstname" expression="get-property('firstname')"/>
         </log>
         <payloadFactory media-type="xml">
            <format>
               <GetEmployeeDetailsResponse xmlns="">
                  <out>$1</out>
               </GetEmployeeDetailsResponse>
            </format>
            <args>
               <arg evaluator="xml" expression="get-property('firstname')"/>
            </args>
         </payloadFactory>
      </inSequence>
      <outSequence>
         <log level="full" category="DEBUG"/>
      </outSequence>
   </target>
   <publishWSDL uri="file:/development/data/wso2/wsdl/Employee.wsdl"/>
   <description/>
</proxy>
Was it helpful?

Solution

You have to send back the message generated by your payloadFactory in your inSequence :

<header name="To" action="remove"/>
<property name="RESPONSE" value="true" scope="default" type="STRING"/>
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
<send/>

Your mediation is "OUT_ONLY", so, your outSequence will never been executed

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top