Oauth 使用wso2 esb发出请求应用程序/x-www-form-urlencoded

Oauth 使用wso2 esb发出请求应用程序/x-www-form-urlencoded,oauth,wso2,wso2esb,Oauth,Wso2,Wso2esb,我正在尝试检索一个令牌OAuth2。但我不知道如何使用wso2esb发出x-www-form-URLEcoded请求。 这是我的代码片段: <?xml version="1.0" encoding="UTF-8"?> <sequence name="test-oauth_v1" xmlns="http://ws.apache.org/ns/synapse"> <in> <property name="RESPONSE" scop

我正在尝试检索一个令牌OAuth2。但我不知道如何使用wso2esb发出x-www-form-URLEcoded请求。 这是我的代码片段:

 <?xml version="1.0" encoding="UTF-8"?>
<sequence name="test-oauth_v1" xmlns="http://ws.apache.org/ns/synapse">
    <in>
        <property name="RESPONSE" scope="default" value="true"/>
        <property action="remove" name="NO_ENTITY_BODY" scope="axis2"/>
        <header action="remove" name="To"/>
        <property name="messageType" value="application/json" scope="axis2" type="STRING"/>
         <property name="basicAuth" scope="default" type="STRING" value="Z3FZVFhUQnhkQlVGNDloblxxzedtSGRBQ1kySWpmSmNvZXdh"/>


        <script language="js"><![CDATA[

            var body = {};
            body.grant_type = 'password';
            body.username = 'xxxx';
            body.password = 'xxxxxxx';
            mc.setPayloadJSON(body);

        ]]></script>    

        <property name="messageType" scope="default" type="STRING" value="application/x-www-form-urlencoded"/>
        <header
            expression="fn:concat('Basic ', get-property('basicAuth'))"
            name="Authorization" scope="transport" xmlns:ns="http://org.apache.synapse/xsd"/>
        <call>
            <endpoint key="server_token_oauth"/>
        </call> 

        <send />
    </in>
</sequence> 

你有什么建议吗


向您致意

您可以参考此示例。messageType的作用域应为axis2



我试过那个例子,但没有成功。我会把我的顺序写在答案里
<property name="messageType" value="application/x-www-form-urlencoded" scope="axis2" type="STRING"/>     
<property name="DISABLE_CHUNKING" value="true" scope="axis2" type="STRING"/>