当涉及 SOAP Web 服务时,处理图像最有效、最稳健的方法是什么?
我有一个 Android 应用程序,它将调用 SOAP Web 服务来获取一些数据。
为了解决这个问题,我们将假设其数据与汽车有关。
我已经返回有关汽车的文本数据(品牌、型号等),这是最简单的部分。我还想以某种方式返回汽车的图像。
到目前为止,我看到两个可行的选择:
- 检索 SOAP 响应中的图像(甚至不知道这是否是 可能)
- 检索 SOAP 响应中指向图像的 URL, 也许是网络图像的 URL
谁能提供有关实现此目标的可靠解决方案的建议?
谢谢
I have an android application, that will call a SOAP web service for some data.
For the purpose of this question, we'll assume its data about cars.
I've got as far as returning text data about the car (make, model etc), that is the easy part. I'd also like to return an image of the car some how.
So far, I see two viable options :
- Retrieve the image in the SOAP response (don't even know if this is
possible) - Retrieve a URL in the SOAP response that points to the image,
perhaps a URL to a web image
Could anyone please give advice as to what is a robust solution for achieving this?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
选项2,当然可以。如果您选择选项 1,则只能在完全下载整个邮件(包括编码图像)后才能显示。这可能需要一段时间。另一方面,如果您只包含 URL,则可以下载消息、呈现 UI,然后下载图像并在图像完成从 Web 获取时动态更新这些图像视图。这会带来响应速度更快的 UI,尤其是在数据连接可能不那么快或不可靠的移动环境中。
Option 2, definitely. If you do option 1, you're limited to displaying only after you've completely downloaded the entire message, including the encoded images. That can take a while. On the other hand, if you just include URLs, you can download the message, render your UI, then download the images and update those image views dynamically as the images finish fetching from the web. This results in a much more responsive UI, especially in a mobile environment where your data connection may not be as fast or reliable.