0

Helo,.

I'm trying to execute the following command :

curl -d "param1=A&param[2]=B&param[3]=username&param[4]=password" https://dev-domain.com/test/

And I get the expected results.

But when I try to implement it using WSO2 API Manager, using the API synapse below,

<?xml version="1.0" encoding="UTF-8"?><api xmlns="http://ws.apache.org/ns/synapse" name="admin--auth" context="/auth" version="1.0.0" version-type="url">
    <resource methods="POST" url-mapping="/*">
        <inSequence>
            <property name="POST_TO_URI" value="true" scope="axis2"/>       

            <filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION">
                <then>
                    <send>
                        <endpoint name="admin--auth_APIproductionEndpoint_0">                           
                            <http uri-template="https://dev-domain.com/test/">
                                <timeout>
                                    <duration>30000</duration>
                                    <responseAction>fault</responseAction>
                                </timeout>
                                <suspendOnFailure>
                                    <errorCodes>-1</errorCodes>
                                    <initialDuration>0</initialDuration>
                                    <progressionFactor>1.0</progressionFactor>
                                    <maximumDuration>0</maximumDuration>
                                </suspendOnFailure>
                                <markForSuspension>
                                    <errorCodes>-1</errorCodes>
                                </markForSuspension>
                            </http>
                        </endpoint>
                    </send>
                </then>
                <else>
                    <sequence key="_sandbox_key_error_"/>
                </else>
            </filter>
        </inSequence>
        <outSequence>
            <send/>
        </outSequence>
    </resource>
    <handlers>
        <handler class="org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler"/>
        <handler class="org.wso2.carbon.apimgt.gateway.handlers.throttling.APIThrottleHandler">
            <property name="id" value="A"/>
            <property name="policyKey" value="gov:/apimgt/applicationdata/tiers.xml"/>
        </handler>
        <handler class="org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageHandler"/>
        <handler class="org.wso2.carbon.apimgt.usage.publisher.APIMgtGoogleAnalyticsTrackingHandler">
            <property name="configKey" value="gov:/apimgt/statistics/ga-config.xml"/>
        </handler>
        <handler class="org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler"/>
    </handlers>
</api>

And I test with the following command :

curl -d "param1=A&param[2]=B&param[3]=username&param[4]=password" http://apiserver.com:8280/auth/1.0.0

I got unexpected result, the result are : 404, Page Not Found

Since the endpoint address is secure connection, I have registering the certificate to [API_MGR_HOME]/repository/resources/security/client-truststore.jks

I think the result should be the same if i directly accessing the endpoint in curl.

Is there anything I have not done?, or is there any suggestion so I can get the same result. it must be done using WSO2 API Manager.

Please let me know if there any comment or suggestion, Thanks in advance.

Community
  • 1
  • 1
Rio
  • 27
  • 5

1 Answers1

0

already solved by removing POST_TO_URI property.

Rio
  • 27
  • 5
  • Can you please share where is this property set. We are facing the same error. – gammay Mar 24 '15 at 12:38
  • not set but remove, the property POST_TO_URI is inside the sequence, in the sample above, it is inside inSequence tag. – Rio Mar 26 '15 at 02:09