如何在WSO2 EI中发送RESTAPI调用以发送请求和下载
我有链接例如“ https://些东西”由客户提供,通过邮递员,我必须单击“发送和下载”,而仅发送以使其正常工作 单击“发送和下载”时,它下载文件,但是在哪里,就在我单击时,单击它仅发送响应200ok,但空白响应是不正确的。 我试图在WSO2 EI中复制相同的内容,以下是我的代码。 但这只是下载空白响应而不是文件。 应该添加什么才能使它像邮递员一样工作以接受“发送和下载”选项?
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="Proxy" startOnLoad="true" transports="http https vfs" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<call>
<endpoint>
<http method="post" uri-template="https://abcd">
</http>
</endpoint>
</call>
<log>
<property expression="get-property('axis2', 'HTTP_SC')" name="log-1"/>
</log>
<filter regex="200" source="get-property('axis2', 'HTTP_SC')">
<then>
<call>
<endpoint>
<http method="post" uri-template="https://efgh">
</http>
</endpoint>
</call>
<log>
<property expression="get-property('axis2', 'HTTP_SC')" name="log-2"/>
</log>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
<property name="ClientApiNonBlocking" value="true" scope="axis2" action="remove"/>
<property name="OUT_ONLY" value="true"/>
<send>
<endpoint>
<address uri="vfs:file:///C:/Work"/>
</endpoint>
</send>
</then>
</filter>
</inSequence>
<outSequence/>
<faultSequence/>
</target>
</proxy>
I have link for example 'https://something' provided by client and through postman I have to click on 'send and download' instead only send to make it work
On clicking 'send and download' it downloads file but where as if I click only send it responds 200OK but blank response which is not correct.
I am trying to replicate the same in WSO2 EI, below is my code.
But it is only downloading blank response not the file.
what should be added to make it work like postman to accept 'send and download' option?
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="Proxy" startOnLoad="true" transports="http https vfs" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<call>
<endpoint>
<http method="post" uri-template="https://abcd">
</http>
</endpoint>
</call>
<log>
<property expression="get-property('axis2', 'HTTP_SC')" name="log-1"/>
</log>
<filter regex="200" source="get-property('axis2', 'HTTP_SC')">
<then>
<call>
<endpoint>
<http method="post" uri-template="https://efgh">
</http>
</endpoint>
</call>
<log>
<property expression="get-property('axis2', 'HTTP_SC')" name="log-2"/>
</log>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
<property name="ClientApiNonBlocking" value="true" scope="axis2" action="remove"/>
<property name="OUT_ONLY" value="true"/>
<send>
<endpoint>
<address uri="vfs:file:///C:/Work"/>
</endpoint>
</send>
</then>
</filter>
</inSequence>
<outSequence/>
<faultSequence/>
</target>
</proxy>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论