WSO2 API Manager 1.10问题 [英] WSO2 API Manager 1.10 issue

查看:114
本文介绍了WSO2 API Manager 1.10问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们遇到一个问题,即当Content-Length超过1068时,对WSO2 API REST端点的调用失败,并显示"412 Precondition Failed".仅向请求添加空格(将大小增加到1069)会导致此失败.如果调用API的速度足够快(使用SOAPUI进行测试),则当内容长度小于1069时,也会发生此问题.我们有一个理论,即报头和正文在数据包之间分割,并使请求混乱.我们试图关闭分块,但这并没有影响任何事情.直接调用后端REST服务时,效果很好.

We are running into an issue where a call to a WSO2 API REST endpoint fails with a "412 Precondition Failed" when the Content-Length exceeds 1068. Just adding a space to the request (increasing size to 1069) causes this failure. This issue can also happen when content length is less than 1069, if the API is called fast enough (using SOAPUI for testing). We have a theory that the header and body are split between packets and confuses the request. We tried turning off chunking and that didn't affect things. When the back end REST service is called directly it works fine.

推荐答案

如果您正在调用SOAP端点,则可以通过使用属性中介器来关闭以下分块.但是您必须确保SOAP端点也希望收到未分块的请求.

You can turn off the chunking as below by using the property mediator if you are calling the SOAP endpoint. But you have to make sure that the SOAP endpoint is also expecting a non-chunked request.

<property name="DISABLE_CHUNKING" value="true" scope="axis2″/>


但是,如果您使用的是REST端点,则该属性有时可能无法工作.在这种情况下,我们需要确保将 Content-Length 标头附加到请求中.我们可以使用以下两个属性来添加 Content-Length 标头.

But if you are using REST endpoint above property may not work sometimes. In that kind of situation, we need to make sure the Content-Length header is appended to the request. We can use below two properties to append the Content-Length header.

<property name="FORCE_HTTP_CONTENT_LENGTH" value="true" scope="axis2"></property>
<property name="COPY_CONTENT_LENGTH_FROM_INCOMING" value="true" scope="axis2"></property>

顺序抽样代理

     <inSequence>
         <log level="custom">
            <property name="msg" value="Executing IN sequence"></property>
         </log>
         <property name="FORCE_HTTP_CONTENT_LENGTH" value="true" scope="axis2"></property>
         <property name="COPY_CONTENT_LENGTH_FROM_INCOMING" value="true" scope="axis2"></property>
         <send>
            <endpoint>
               <address uri="https://www.google.com" format="rest"></address>
            </endpoint>
         </send>
      </inSequence>

这篇关于WSO2 API Manager 1.10问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆