通过SOAP Web服务传输二进制数据? [英] Transferring binary data through a SOAP webservice?

查看:435
本文介绍了通过SOAP Web服务传输二进制数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个返回一个对象的二进制数组的Web服务。有没有更简单的方法来使用SOAP传递这个还是需要被包含在XML?它的工作,但我不得不增加发送和接收缓冲区为一个较大的值。多少是太多了?

I have a web service that returns the binary array of an object. Is there an easier way to transfer this with SOAP or does it need to be contained in XML? It's working, but I had to increase the send and receive buffer to a large value. How much is too much?

传输二进制的XML作为一个数组似乎真的效率不高,但我看不到任何方式使用.NET添加一个二进制附件。

Transferring binary in XML as an array seems really inefficient, but I can't see any way to add a binary attachment using .NET.

推荐答案

作为一个数组?你的意思是你要发送

As an array? Do you mean that you are sending

<byte>8</byte>
<byte>127</byte>

等?如果是的话,你当然可以通过转换字节数组到十六进制字符串事前,如提高就可以了。

etc? If so then you can certainly improve on it by converting the byte array into a hex string beforehand, eg.

<codedArray>087F09AFBD.....</codedArray>

这是用于发送图像等最常用的方法,通过SOAP。但是,即使如此,你是正确的质疑了。你真的应该寻找其他更RESTful的传输协议,恕我直言。

This is the most common approach for sending images, etc, via SOAP. However, even then you are correct to question it. You should really be looking at other, more RESTful transfer protocols, IMHO.

这篇关于通过SOAP Web服务传输二进制数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆