Search code examples
wso2wso2-integration-studio

WSO2: Can't find endpoint, error code 305100, error message: "Couldn't find the endpoint with the key"


I'm trying to call an endpoint from a sequence using WSO2 Integration Studios. Whenever I define the endpoint in-line, my code works fine and I get a response from the endpoint. Whenever I define the endpoint as a separate entity, it stops working and I get the following error-message: "MESSAGE = An unexpected error occurred., REST_API = null, ERROR_CODE = 305100, ERROR_MESSAGE = Couldn't find the endpoint with the key..."

My code looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<sequence name="XMLSeq" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
    <log category="TRACE" description="Log Request Payload"/>
        <call description="Send request to the endpoint">
            <endpoint key="TestEndpoint" />                   
        </call>
</sequence>

<?xml version="1.0" encoding="UTF-8"?>
<endpoint name="TestEndpoint" xmlns="http://ws.apache.org/ns/synapse">
    <http method="get" uri-template="https://[api]">
        <suspendOnFailure>
            <initialDuration>-1</initialDuration>
            <progressionFactor>1.0</progressionFactor>
        </suspendOnFailure>
        <markForSuspension>
            <retriesBeforeSuspension>0</retriesBeforeSuspension>
        </markForSuspension>
    </http>
</endpoint>

For reference, my code does work when it looks like this:

`<?xml version="1.0" encoding="UTF-8"?>
<sequence name="XMLSeq" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
    <log category="TRACE" description="Log Request Payload"/>
        <call description="Send request to the endpoint">
            <endpoint name="TestEndpoint" xmlns="http://ws.apache.org/ns/synapse">
        `       <http method="get" uri-template="https://[api]">
                    <suspendOnFailure>
                        <initialDuration>-1</initialDuration>
                        <progressionFactor>1.0</progressionFactor>
                    </suspendOnFailure>
                    <markForSuspension>
                        <retriesBeforeSuspension>0</retriesBeforeSuspension>
                    </markForSuspension>
                </http>
            </endpoint>                  
        </call>
</sequence>

Solution

  • This "Couldn't find the endpoint with the key.." error occurred when EI/ESB cannot find the endpoint configuration in the synapse configuration space.

    Check whether you have added it to the composite application project when bundling all the synapse xml artefacts to the .car file.