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

本文是小编为大家收集整理的关于WSO2 API Manager 1.10问题的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我们正在运行到一个问题,其中对WSO2 API REST端点的调用失败,当内容长度超过1068时,"412先决条件失败"失败.只需将空格添加到请求(升高到1069)导致此故障.如果内容长度小于1069,则此问题也可能发生,如果API速度足够快(使用SOAPUI进行测试).我们有一个理论,标题和身体在数据包之间分离并使请求混淆.我们尝试关掉块,并没有影响事情.当后端休息服务直接调用时,它可以正常工作.

推荐答案

如果您调用SOAP端点,则可以使用属性介体关闭以下块.但是,您必须确保SOAP端点也期望非块的请求.

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


但如果您使用的是休息端点,则属性可能无法工作.在这种情况下,我们需要确保<强>内容长度标题附加到请求.我们可以使用以下两个属性来追加 content-length 标题.

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

样本代理insequence

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

本文地址:https://www.itbaoku.cn/post/1937753.html

问题描述

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.

推荐答案

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″/>


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>

Sample proxy inSequence

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