1

Use Case: I recently came upon a problem while creating an integration in WSO2 Integration Studio, I have an API with 2 resources, one is a POST, the other is a GET

Problem: when I run the integration to test it, the POST request works fine while the GET request gives me the code 202 accepted without even calling the endpoint

Code: this is my code, in the second sequence the log is printed alright but the call isn't executed

<api context="/flow" name="companyflow" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="POST" uri-template="/createIssues">
        <inSequence>
            <call>
                <endpoint key="IssueEndpoint"/>
            </call>
            <respond/>
        </inSequence>
        <outSequence/>
        <faultSequence/>
    </resource>

    <resource methods="GET" uri-mapping="/getIssues">
       <inSequence>
        <log>
          <property name="text" value="HelloThere"/>
        </log>
        <call>
          <endpoint key="issuesList"/>
        </call>
        <respond/>
       </inSequence>
       <outSequence/>
       <faultSequence/>
    </resource>
</api>

Tip:: I suspect the problem may be related to uri-template and uri-mapping but I'm not sure

Community
  • 1
  • 1
Hyperion
  • 198
  • 1
  • 3
  • 18

1 Answers1

1

There is no issue with your integration configurations or syntax. Normally you get a 202 when you have an error in the flow. So I'm suspecting your Endpoint reference is wrong. Double check whether the key is correct and the endpoint is deployed to MI. (Make sure it's selected in the Capp pom file)

        <call>
          <endpoint key="issuesList"/>
        </call>
ycr
  • 12,828
  • 2
  • 25
  • 45
  • Well you're right, I found out that the problem was caused when choosing "export project artifacts" and it turned out that "issuesList" endpoint wasn't selected among the artifacts even though the project itself was. Thanks for helping me pinpoint the cause – Hyperion Jun 07 '22 at 09:56