簡體   English   中英

WSO2 API Manager意外結果與CURL比較

[英]WSO2 API Manager unexpected result compare with CURL

喂,

我正在嘗試執行以下命令:

curl -d“ param1 = A&param [2] = B&param [3] =用戶名&param [4] =密碼” https://dev-domain.com/test/

我得到了預期的結果。

但是,當我嘗試使用WSO2 API管理器,下面的API突觸來實現它時,

<?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>

我用以下命令進行測試:

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

我得到了意外的結果,結果是:404,找不到頁面

由於端點地址是安全連接,因此我已將證書注冊到[API_MGR_HOME] /repository/resources/security/client-truststore.jks

我認為如果我直接在curl中訪問端點,結果應該是相同的。

有什么我沒做過的事嗎?或者有什么建議可以使我得到相同的結果。 必須使用WSO2 API管理器來完成。

請讓我知道是否有任何意見或建議,謝謝。

已通過移除POST_TO_URI屬性解決。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM