首页 文章

wso2 esb 4.8.1 callout mediator和multipart / form-data bug?

提问于
浏览
0

我们在callout和multipart / form-data方面遇到问题我们的api用于上传文件我们已经配置了这个构建器和格式化程序

<messageBuilder contentType="multipart/form-data" class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
<messageFormatter contentType="multipart/form-data" class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>

But in execution we see that org.wso2.carbon.relay.BinaryRelayBuilder is used, but when we call an endpoint with callout mediator the message formater that is executed is MultipartFormDataBuilder instead ExpandingMessageFormatter, that make that the attachment don't arrive to the endpoint (we supose this is a bug)

<api xmlns="http://ws.apache.org/ns/synapse" name="CloneTest" context="/cloneTest">
   <resource methods="POST" uri-template="/test6">
      <inSequence>
         <sequence key="Clone3Sequence"></sequence>
         <log level="full">
            <property name="***** IN Estoy en el GET /cloneTest/test5 sequence11- $.clave = " expression="json-eval($.clave)"></property>
         </log>
         <drop></drop>
      </inSequence>

<sequence xmlns="http://ws.apache.org/ns/synapse" name="Clone3Sequence" trace="disable">
   <property name="HTTP_METHOD" value="POST" scope="axis2"></property>
   <callout serviceURL="http://localhost:1234/ProyectoWebMultipartForm/UploadServlet/recurso1">
      <source type="envelope"></source>
      <target key="RESPUESTA"></target>
   </callout>
   <property xmlns:ns="http://org.apache.synapse/xsd" name="RESPUESTAAAAAAAA" expression="get-property('RESPUESTA')"></property>
</sequence>

请求到达esb

POST /cloneTest/test6 HTTP/1.1
Host: 127.0.0.1:1234
Connection: keep-alive
Content-Length: 300
Cache-Control: no-cache
Origin: chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop
apikey: b7608e32c2bb4aaa85c47584bf1b5508
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryNuCtYYL1ByZXkmrY
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36
Postman-Token: 218244a6-8fc3-1911-b2db-22ff2bf93bd1
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: es-ES,es;q=0.8

------WebKitFormBoundaryNuCtYYL1ByZXkmrY
Content-Disposition: form-data; name="payload"

{"a","b"}
------WebKitFormBoundaryNuCtYYL1ByZXkmrY
Content-Disposition: form-data; name="file"; filename="prueba.txt"
Content-Type: text/plain

pruebaaaaaaaa
------WebKitFormBoundaryNuCtYYL1ByZXkmrY--

请求到达 endpoints

POST /ProyectoWebMultipartForm/UploadServlet/recurso1/test6 HTTP/1.1
Content-Type: multipart/form-data; charset=UTF-8; boundary=MIMEBoundary_02d66e5320a1bf4a46f61b9faa892f7837ffed6e9ee5e74d
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: es-ES,es;q=0.8
apikey: b7608e32c2bb4aaa85c47584bf1b5508
Cache-Control: no-cache
Origin: chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop
Postman-Token: 218244a6-8fc3-1911-b2db-22ff2bf93bd1
User-Agent: Axis2
Host: 127.0.0.1:1234
Transfer-Encoding: chunked

0

我们认为这是WSO2 4.8.1版本中的一个错误,有人可以向我们确认这个吗?

提前致谢

1 回答

  • 1

    您是否检查了ESB_HOME / repository / conf / axis2 / axis2_blocking_client.xml中已定义的消息格式化程序和构建器以获取特定的contentType(multipart / form-data),因为callout介体用于以阻塞方式发送请求 . 所以它在内部使用axis2_blocking_client.xml

相关问题