如何解决WSo2 API管理器按顺序使用调用介体来调用其余API,该API返回空的JSON有效负载响应,但响应头中的值
我们正在使用WSo2 API Manager 2.1.0。 在API Publisher中配置API时,我们希望在调用目标API之前添加一系列调用。因此,我们添加了In Sequence流,在调解器调用中,我们调用REST API,该API返回响应标头中的值,并返回200的空JSON有效负载。 在WSO2 API管理器中,我们得到以下响应。
:fault> 401001 :code>状态报告 :type>运行时错误 :message>有效负载不是JSON字符串。 :description>
<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 举报,一经查实,本站将立刻删除。