WSo2 API管理器按顺序使用调用介体来调用其余API,该API返回空的JSON有效负载响应,但响应头中的值

问题描述

我们正在使用WSo2 API Manager 2.1.0。 在API Publisher中配置API时,我们希望在调用目标API之前添加一系列调用。因此,我们添加了In Sequence流,在调解器调用中,我们调用REST API,该API返回响应标头中的值,并返回200的空JSON有效负载。 在WSO2 API管理器中,我们得到以下响应。

401001 :code> 状态报告:type> 运行时错误:message> 有效负载不是JSON字符串。:description> :fault>

<header name="Content-Type" scope="transport" value="application/json"/>
        <property name="messageType" scope="transport" type="STRING" value="application/json"/> 
        <log level="full"/>
        <header name="site_id" scope="transport" value="004ada8a-6a11-f080-f56c-12dd3808e8f7"/>
        <header expression="fn:concat('Bearer ',get-property('generated-access-token'))" name="Authorization" scope="transport" xmlns:ns3="http://org.apache.synapse/xsd" xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"/>
        <call blocking="true">
            <endpoint>
                <http method="put" uri-template="https://wso2.domainname.com/api/v1.0/users/me/login-defaults">
                    <suspendOnFailure>
                        <initialDuration>-1</initialDuration>
                        <progressionFactor>1</progressionFactor>
                    </suspendOnFailure>
                    <markForSuspension>
                        <retriesBeforeSuspension>0</retriesBeforeSuspension>
                    </markForSuspension>
                </http>
            </endpoint>
        </call>
        <log level="full"/>
        <property description="session-id" expression="$trp:X-NG-SessionId" name="session-id" scope="default" type="STRING"/>
        <log level="custom">
            <property expression="$trp:X-NG-SessionId" name="Access Token after call if block"/>
        </log>
        <property expression="$ctx:resource" name="REST_URL_POSTFIX" scope="axis2" type="STRING"/>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)