-1

I have attempted to implement an API using Integration Studio, but I did not receive the correct response. Instead of the expected text/html response, I received a different response. How can I address this issue? the native API invoked using postman

the Integration studio Api invoked using postman

this is the code config in my integration studio API

<?xml version="1.0" encoding="UTF-8"?>
<api context="/****" name="***" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="POST" uri-template="/****">
        <inSequence>
            <property description="messageProperty" name="messageType" scope="axis2" type="STRING" value="text/xml"/>
            <call>
                <endpoint>
                    <http method="post" uri-template="https://www.amenbank.com.tn/php/simulator.php?ts=1684227888868">
                        <suspendOnFailure>
                            <initialDuration>-1</initialDuration>
                            <progressionFactor>-1</progressionFactor>
                            <maximumDuration>0</maximumDuration>
                        </suspendOnFailure>
                        <markForSuspension>
                            <retriesBeforeSuspension>0</retriesBeforeSuspension>
                        </markForSuspension>
                    </http>
                </endpoint>
            </call>
            <respond/>
        </inSequence>
        <outSequence/>
        <faultSequence/>
    </resource>
</api>
manar
  • 9
  • 3
  • What errors do you see in the logs? What do you mean it's not working? – ycr May 17 '23 at 15:42
  • There are no errors recorded in the log files. – manar May 17 '23 at 15:51
  • What is the difference you see in the response? – ycr May 17 '23 at 15:52
  • this is the first: .....\r\n Nbre Ech\u00e9ances<\/strong><\/td>\r\n 12<\/td>\r\n <\/tr>\r\n \r\n Taux(%)<\/strong><\/td>\r\n 12.53<\/td>\r\n <\/tr>\r\n \r\n Ech\u00e9ances<\/strong><\/td>\r\n 71.278<\/td>\r\n <\/tr>\r\n <\/table>"} – manar May 17 '23 at 15:58
  • and this is second : {"result":-1,"error_label":"Required fields","errors":[{"name":"product","value":"Required fields"},{"name":"amount","value":"Required fields"},{"name":"drefund","value":"Required fields"},{"name":"prefund","value":"Required fields"},{"name":"emission","value":""},{"name":"echeance","value":""}]} – manar May 17 '23 at 15:59

1 Answers1

0

If you want to send the same Content-Type to the backend, remove the following property from the mediation flow.

 <property description="messageProperty" name="messageType" scope="axis2" type="STRING" value="text/xml"/>
ycr
  • 12,828
  • 2
  • 25
  • 45
  • i removed it but i still have the same issue – manar May 17 '23 at 16:35
  • @manar try enabling wirelogs and see whats the request going out from WSO2. https://apim.docs.wso2.com/en/latest/observe/micro-integrator/classic-observability-logs/configuring-log4j2-properties/#wire-logs-and-header-logs – ycr May 17 '23 at 18:30
  • I think it doesn't read the data I provided for testing because the input type is raw data, perhaps.? – manar May 23 '23 at 10:18