wso2-http PDF响应-在wso2服务器上保存文件而不是下载
我想将响应中的PDF文件直接保存在WSO2服务器上。当我在浏览器中打开API URL时,Chrome会自动在本地计算机上下载文件。如何将此文件直接保存在WSO2服务器上wso2-http PDF响应-在wso2服务器上保存文件而不是下载,wso2,wso2esb,wso2is,esb,Wso2,Wso2esb,Wso2is,Esb,我想将响应中的PDF文件直接保存在WSO2服务器上。当我在浏览器中打开API URL时,Chrome会自动在本地计算机上下载文件。如何将此文件直接保存在WSO2服务器上 <api xmlns="http://ws.apache.org/ns/synapse" name="test" context="/test"> <resource methods="GET" uri-template=&q
<api xmlns="http://ws.apache.org/ns/synapse" name="test" context="/test">
<resource methods="GET" uri-template="/test*">
<inSequence>
<payloadFactory media-type="xml">
<format>
<root>
<mtfId>150</mtfId>
<orderSno>50339375</orderSno>
</root>
</format>
<args/>
</payloadFactory>
<property name="messageType" value="application/x-www-form-urlencoded" scope="axis2" type="STRING"/>
<property name="DISABLE_CHUNKING" value="true" scope="axis2"/>
<call>
<endpoint>
<http method="POST" uri-template="https://www.proceedo.net/suppliercenter/common/orderexport.do"/>
</endpoint>
</call>
<respond/>
</inSequence>
<faultSequence/>
</resource>
</api>
150
50339375
您可以使用文件连接器在ESB服务器中创建文件。请参考[1]了解如何设置文件连接器,您可以使用文件连接器创建操作[2]来实现您的要求
<fileconnector.create>
<filePath>{$ctx:filePath}</filePath>
<inputContent>{$ctx:inputContent}</inputContent>
<encoding>{$ctx:encoding}</encoding>
<setTimeout>{$ctx:setTimeout}</setTimeout>
<setPassiveMode>{$ctx:setPassiveMode}</setPassiveMode>
<setSoTimeout>{$ctx:setSoTimeout}</setSoTimeout>
<setUserDirIsRoot>{$ctx:setUserDirIsRoot}</setUserDirIsRoot>
<setStrictHostKeyChecking>{$ctx:setStrictHostKeyChecking}</setStrictHostKeyChecking>
</fileconnector.create>
{$ctx:filePath}
{$ctx:inputContent}
{$ctx:encoding}
{$ctx:setTimeout}
{$ctx:setPassiveMode}
{$ctx:setSoTimeout}
{$ctx:setUserDirIsRoot}
{$ctx:SetStritThostKeyChecking}
[1]-https://docs.wso2.com/display/ESBCONNECTORS/File+连接器
[2]-https://docs.wso2.com/display/ESBCONNECTORS/Working+使用+文件+连接器#使用文件连接器创建