在 WSO2 ei 中从 ImageURL 获取 Base64 的方法
Way to get Base64 from ImageURL in WSO2 ei
我有像 https://resource.digitaldealer.com.au/image/3281718625d81ce1e136a0008808648_0_0.jpg 这样的 imageURL,我的主要目标是 将图像推送到 Salesforce。为此,我正在尝试 从此 url 获取 Base64。一旦我得到这个 base64,我就会尝试使用 SFDC 的文件概念将 base64 内容上传到 Salesforce。
我在从 imageURL 检索 base64 时卡住了。谁能帮帮我?
仅供参考,代码
<iterate continueParent="true" description="urlIterator" expression="//url" id="listUnread" sequential="true">
<target>
<sequence>
<property description="fileURL" expression="//*[local-name()='url']" name="fileURL" scope="default" type="STRING"/>
<property description="uri.var.url" expression="get-property('fileURL')" name="uri.var.url" scope="default" type="STRING"/>
<log separator="===Input Image URL===">
<property expression="get-property('fileURL')" name="uri.var.url"/>
</log>
<call>
<endpoint>
<http method="get" uri-template="{uri.var.url}"/>
</endpoint>
</call>
<log level="full"/>
</sequence>
</target>
</iterate>
异常:
[2019-12-09 12:26:14,762] [] ERROR - Axis2Sender Unexpected error during sending message out
org.apache.axis2.AxisFault: The system cannot infer the transport information from the %3Curl/%3E URL.
at org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:86)
at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:116)
请参阅此blog,其中解释了如何使用 Enrich Mediator 从 URL 下载图像并使用 Synapse 函数使用 WSO2 ESB 对其进行 base64 编码.
我有像 https://resource.digitaldealer.com.au/image/3281718625d81ce1e136a0008808648_0_0.jpg 这样的 imageURL,我的主要目标是 将图像推送到 Salesforce。为此,我正在尝试 从此 url 获取 Base64。一旦我得到这个 base64,我就会尝试使用 SFDC 的文件概念将 base64 内容上传到 Salesforce。
我在从 imageURL 检索 base64 时卡住了。谁能帮帮我?
仅供参考,代码
<iterate continueParent="true" description="urlIterator" expression="//url" id="listUnread" sequential="true">
<target>
<sequence>
<property description="fileURL" expression="//*[local-name()='url']" name="fileURL" scope="default" type="STRING"/>
<property description="uri.var.url" expression="get-property('fileURL')" name="uri.var.url" scope="default" type="STRING"/>
<log separator="===Input Image URL===">
<property expression="get-property('fileURL')" name="uri.var.url"/>
</log>
<call>
<endpoint>
<http method="get" uri-template="{uri.var.url}"/>
</endpoint>
</call>
<log level="full"/>
</sequence>
</target>
</iterate>
异常:
[2019-12-09 12:26:14,762] [] ERROR - Axis2Sender Unexpected error during sending message out
org.apache.axis2.AxisFault: The system cannot infer the transport information from the %3Curl/%3E URL.
at org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:86)
at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:116)
请参阅此blog,其中解释了如何使用 Enrich Mediator 从 URL 下载图像并使用 Synapse 函数使用 WSO2 ESB 对其进行 base64 编码.